Esempio n. 1
0
function missionfield($cname, $ename, $setting = array(), $datatype = 'text')
{
    global $rprojects;
    $mcell = in_array($datatype, array('images', 'files', 'flashs', 'medias')) ? 1 : 0;
    //是否是多集模式字段
    $noremote = in_array($datatype, array('int', 'float', 'select', 'mselect', 'date')) ? 1 : 0;
    //是否不存在附件下载因素的字段
    ${'clearhtml' . $ename} = isset($setting['clearhtml']) && !$mcell ? explode(',', $setting['clearhtml']) : array();
    $rpidsarr = array('0' => lang('notremote'));
    foreach ($rprojects as $rpid => $rproject) {
        $rpidsarr[$rpid] = $rproject['cname'];
    }
    $frompagearr = array('0' => lang('based_content_page0'), '1' => lang('netsilistpage'), '2' => lang('content_trace_page0_1'), '3' => lang('content_trace_page0_2'));
    echo "<tr class=\"category\"><td><b>[" . mhtmlspecialchars($cname) . "]</b></td><td colspan=\"3\"></td></tr>";
    echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('contensourcpage') . "</td>\n" . "<td width=\"35%\" class=\"item2\"><select style=\"vertical-align: middle;\" name=\"fsettingsnew[{$ename}][frompage]\">" . makeoption($frompagearr, empty($setting['frompage']) ? 0 : $setting['frompage']) . "</select></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('resultdealfunc') . "</td>\n" . "<td class=\"item2\"><input type=\"text\" size=\"25\" name=\"fsettingsnew[{$ename}][func]\" value=\"" . (empty($setting['func']) ? '' : mhtmlspecialchars($setting['func'])) . "\"></td>\n" . "</tr>\n";
    if (!$mcell) {
        echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('fiecontgathpatt') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][ftag]\" cols=\"40\">" . (isset($setting['ftag']) ? mhtmlspecialchars($setting['ftag']) : '') . "</textarea></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('clear') . "Html<br><input class=\"checkbox\" type=\"checkbox\" name=\"chk{$ename}\" onclick=\"checkall(this.form,'clearhtml{$ename}','chk{$ename}')\">" . lang('selectall') . "</td>\n" . "<td class=\"item2\">" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"1\"" . (in_array('1', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;a&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"2\"" . (in_array('2', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;br&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"3\"" . (in_array('3', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;table&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"4\"" . (in_array('4', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;tr&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"5\"" . (in_array('5', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;td&gt;&nbsp;&nbsp;<br>\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"6\"" . (in_array('6', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;p&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"7\"" . (in_array('7', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;font&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"8\"" . (in_array('8', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;div&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"9\"" . (in_array('9', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;span&gt;&nbsp;&nbsp;<br>\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"10\"" . (in_array('10', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;tbody&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"11\"" . (in_array('11', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;b&gt;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"12\"" . (in_array('12', ${'clearhtml' . $ename}) ? " checked" : "") . ">&amp;nbsp;&nbsp;&nbsp;\n" . "<input type=\"checkbox\" class=\"checkbox\" name=\"clearhtml{$ename}[]\" value=\"13\"" . (in_array('13', ${'clearhtml' . $ename}) ? " checked" : "") . ">&lt;script&gt;&nbsp;&nbsp;\n" . "</td>\n" . "</tr>\n";
        echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('replmesssouront') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][fromreplace]\" cols=\"40\">" . (isset($setting['fromreplace']) ? mhtmlspecialchars($setting['fromreplace']) : '') . "</textarea></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('repmessagresulcont') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][toreplace]\" cols=\"40\">" . (isset($setting['toreplace']) ? mhtmlspecialchars($setting['toreplace']) : '') . "</textarea></td>\n" . "</tr>\n";
    } else {
        echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('lisregigathpatt') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][ftag]\" cols=\"40\">" . (isset($setting['ftag']) ? mhtmlspecialchars($setting['ftag']) : '') . "</textarea></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('liscellsplitag') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][splittag]\" cols=\"40\">" . (isset($setting['splittag']) ? mhtmlspecialchars($setting['splittag']) : '') . "</textarea></td>\n" . "</tr>\n";
        echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('cellurlgathpatte') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][remotetag]\" cols=\"40\">" . (isset($setting['remotetag']) ? mhtmlspecialchars($setting['remotetag']) : '') . "</textarea></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('celltitlgathepatt') . "</td>\n" . "<td class=\"item2\"><textarea rows=\"4\" name=\"fsettingsnew[{$ename}][titletag]\" cols=\"40\">" . (isset($setting['titletag']) ? mhtmlspecialchars($setting['titletag']) : '') . "</textarea></td>\n" . "</tr>\n";
    }
    if (!$noremote) {
        echo "<tr>\n" . "<td width=\"15%\" class=\"item1\">" . lang('remote_download') . "</td>\n" . "<td width=\"35%\" class=\"item2\"><select style=\"vertical-align: middle;\" name=\"fsettingsnew[{$ename}][rpid]\">" . makeoption($rpidsarr, empty($setting['rpid']) ? 0 : $setting['rpid']) . "</select></td>\n" . "<td width=\"15%\" class=\"item1\">" . lang('downjumfilsty') . "</td>\n" . "<td class=\"item2\"><input type=\"text\" size=\"25\" name=\"fsettingsnew[{$ename}][jumpfile]\" value=\"" . (empty($setting['jumpfile']) ? '' : mhtmlspecialchars($setting['jumpfile'])) . "\"></td>\n" . "</tr>\n";
    }
}
/**
 * Returns a valid html tag for the choosen $fieldType for pathes
 *
 * @param  string   path       The path to start searching in
 * @param  integer  uid        The uid which must match the found directories
 * @param  integer  gid        The gid which must match the found direcotries
 * @param  string   fieldType  Either "Manual" or "Dropdown"
 * @return string   The html tag for the choosen $fieldType
 *
 * @author Martin Burchert  <*****@*****.**>
 * @author Manuel Bernhardt <*****@*****.**>
 */
function makePathfield($path, $uid, $gid, $fieldType, $value = '')
{
    global $lng;
    $value = str_replace($path, '', $value);
    $field = '';
    if ($fieldType == 'Manual') {
        $field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" size="30" />';
    } elseif ($fieldType == 'Dropdown') {
        $dirList = findDirs($path, $uid, $gid);
        natcasesort($dirList);
        if (sizeof($dirList) > 0) {
            $field = '<select name="path">';
            foreach ($dirList as $key => $dir) {
                if (strpos($dir, $path) === 0) {
                    $dir = makeCorrectDir(substr($dir, strlen($path)));
                }
                $field .= makeoption($dir, $dir, $value);
            }
            $field .= '</select>';
        } else {
            $field = $lng['panel']['dirsmissing'];
            $field .= '<input type="hidden" name="path" value="/" />';
        }
    }
    return $field;
}
Esempio n. 3
0
function phpVersionOptions($customerID, $domainID)
{
    global $db, $availablePHPVersions;
    $selectedPHPVersion = currentPHPVersion($customerID, $domainID);
    $phpVersionOptions = '';
    foreach ($availablePHPVersions as $phpVersion) {
        if (checkNitradoServiceLimit($customerID, 'php', 'php_version', $phpVersion)) {
            $phpVersionOptions .= makeoption($phpVersion, $phpVersion, $selectedPHPVersion, true);
        }
    }
    return $phpVersionOptions;
}
function getFormOverviewGroupOutput($groupname, $groupdetails)
{
    global $lng, $filename, $s, $theme;
    $group = '';
    $title = $groupdetails['title'];
    $part = $groupname;
    $activated = true;
    $option = '';
    if (isset($groupdetails['fields'])) {
        foreach ($groupdetails['fields'] as $fieldname => $fielddetails) {
            if (isset($fielddetails['overview_option']) && $fielddetails['overview_option'] == true) {
                if ($fielddetails['type'] != 'option' && $fielddetails['type'] != 'bool') {
                    standard_error('overviewsettingoptionisnotavalidfield');
                }
                if ($fielddetails['type'] == 'option') {
                    $options_array = $fielddetails['option_options'];
                    $options = '';
                    foreach ($options_array as $value => $vtitle) {
                        $options .= makeoption($vtitle, $value, Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
                    }
                    $option .= $fielddetails['label'] . ':&nbsp;';
                    $option .= '<select class="dropdown_noborder" name="' . $fieldname . '">';
                    $option .= $options;
                    $option .= '</select>';
                    $activated = true;
                } else {
                    $option .= $lng['admin']['activated'] . ':&nbsp;';
                    $option .= makeyesno($fieldname, '1', '0', Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']));
                    $activated = (int) Settings::Get($fielddetails['settinggroup'] . '.' . $fielddetails['varname']);
                }
            }
        }
    }
    /**
     * this part checks for the 'websrv_avail' entry in the settings
     * if found, we check if the current webserver is in the array. If this
     * is not the case, we change the setting type to "hidden", #502
     */
    $do_show = true;
    if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
        $websrv = Settings::Get('system.webserver');
        if (!in_array($websrv, $groupdetails['websrv_avail'])) {
            $do_show = false;
            $title .= sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
            // hack disabled flag into select-box
            $option = str_replace('<select class', '<select disabled="disabled" class', $option);
        }
    }
    eval("\$group = \"" . getTemplate("settings/settings_overviewgroup") . "\";");
    return $group;
}
/**
 * Returns a valid html tag for the chosen $fieldType for paths
 *
 * @param string  path      The path to start searching in
 * @param integer uid       The uid which must match the found directories
 * @param integer gid       The gid which must match the found direcotries
 * @param string  value     the value for the input-field
 *
 * @return string   The html tag for the chosen $fieldType
 *
 * @author Martin Burchert  <*****@*****.**>
 * @author Manuel Bernhardt <*****@*****.**>
 */
function makePathfield($path, $uid, $gid, $value = '', $dom = false)
{
    global $lng;
    $value = str_replace($path, '', $value);
    $field = array();
    // path is given without starting slash
    // but dirList holds the paths with starting slash
    // so we just add one here to get the correct
    // default path selected, #225
    if (substr($value, 0, 1) != '/' && !$dom) {
        $value = '/' . $value;
    }
    $fieldType = Settings::Get('panel.pathedit');
    if ($fieldType == 'Manual') {
        $field = array('type' => 'text', 'value' => htmlspecialchars($value));
    } elseif ($fieldType == 'Dropdown') {
        $dirList = findDirs($path, $uid, $gid);
        natcasesort($dirList);
        if (sizeof($dirList) > 0) {
            if (sizeof($dirList) <= 100) {
                $_field = '';
                foreach ($dirList as $key => $dir) {
                    if (strpos($dir, $path) === 0) {
                        $dir = substr($dir, strlen($path));
                        // docroot cut off of current directory == empty -> directory is the docroot
                        if (empty($dir)) {
                            $dir = '/';
                        }
                        $dir = makeCorrectDir($dir);
                    }
                    $_field .= makeoption($dir, $dir, $value);
                }
                $field = array('type' => 'select', 'value' => $_field);
            } else {
                // remove starting slash we added
                // for the Dropdown, #225
                $value = substr($value, 1);
                //$field = $lng['panel']['toomanydirs'];
                $field = array('type' => 'text', 'value' => htmlspecialchars($value), 'note' => $lng['panel']['toomanydirs']);
            }
        } else {
            //$field = $lng['panel']['dirsmissing'];
            //$field = '<input type="hidden" name="path" value="/" />';
            $field = array('type' => 'hidden', 'value' => '/', 'note' => $lng['panel']['dirsmissing']);
        }
    }
    return $field;
}
Esempio n. 6
0
 function trfield($varpre = '', $noeditstr = '', $ftype = '', $typeid = 0)
 {
     if (empty($this->field['ename']) || empty($this->field['available'])) {
         return;
     }
     $trname = ($this->field['notnull'] ? '*' : '') . $this->field['cname'] . $noeditstr;
     $varname = !$varpre ? $this->field['ename'] : $varpre . '[' . $this->field['ename'] . ']';
     $oldstr = $this->isadd ? $this->field['vdefault'] : $this->oldvalue;
     //多项选择
     foreach (array('datatype', 'mode', 'guide', 'min', 'max') as $var) {
         ${$var} = $this->field[$var];
     }
     if ($datatype == 'cacc') {
         $setting = empty($this->field['innertext']) ? array() : unserialize($this->field['innertext']);
         trcacc($trname, $varname, $oldstr, $this->field['length'], @$setting['source'], @$setting['ids'], $mode, $max ? intval($max) : 0, $guide);
     } else {
         if (in_array($datatype, array('text', 'int', 'float'))) {
             $oldstr = mhtmlspecialchars($oldstr);
             $datatype = 'text';
         } elseif ($datatype == 'select') {
             $sourcearr = select_arr($this->field['innertext'], $this->field['fromcode']);
             $oldstr = !$mode ? makeoption($sourcearr, $oldstr) : makeradio($varname, $sourcearr, $oldstr);
         } elseif ($datatype == 'mselect') {
             $sourcearr = select_arr($this->field['innertext'], $this->field['fromcode']);
             $oldarr = explode("\t", $oldstr);
             $oldstr = !$mode ? multiselect($varname . '[]', $sourcearr, $oldarr) : makecheckbox($varname . '[]', $sourcearr, $oldarr);
         } elseif ($datatype == 'multitext') {
             $oldstr = mhtmlspecialchars($oldstr);
         } elseif ($datatype == 'date') {
             $oldstr = $oldstr ? date('Y-m-d', $oldstr) : '';
         } elseif ($datatype == 'map') {
             !$oldstr && ($oldstr = $this->field['vdefault']);
             $min = $this->field['length'];
         } elseif ($datatype == 'vote') {
             $mode = $ftype;
             $max = $min;
             $min = $typeid;
         }
         trspecial($trname, $varname, $oldstr, $datatype, $mode, $guide, $min, $max);
     }
     $this->make_submitstr($varname);
 }
/**
 * This file is part of the Froxlor project.
 * Copyright (c) 2003-2009 the SysCP Team (see authors).
 * Copyright (c) 2010 the Froxlor Team (see authors).
 *
 * For the full copyright and license information, please view the COPYING
 * file that was distributed with this source code. You can also view the
 * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Florian Lippert <*****@*****.**> (2003-2009)
 * @author     Froxlor team <*****@*****.**> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Functions
 *
 */
function getFormFieldOutputOption($fieldname, $fielddata)
{
    $returnvalue = '';
    if (isset($fielddata['option_options']) && is_array($fielddata['option_options']) && !empty($fielddata['option_options'])) {
        if (isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple') {
            $multiple = true;
            $fielddata['value'] = explode(',', $fielddata['value']);
        } else {
            $multiple = false;
        }
        $label = $fielddata['label'];
        $options_array = $fielddata['option_options'];
        $options = '';
        foreach ($options_array as $value => $title) {
            $options .= makeoption($title, $value, $fielddata['value']);
        }
        eval("\$returnvalue = \"" . getTemplate("formfields/option", true) . "\";");
    }
    return $returnvalue;
}
/**
 * Get all date interval types as an array or option code
 *
 * @param  string Either array or option, affects the value returned by function
 * @param  string Only relevant when first argument is option, this one will be the selected one
 * @return mixed  Depends on first option, array of intervaltypes or optioncode of intervaltypes ready to be inserted in a select statement
 *
 * @author Former03 GmbH :: Florian Lippert <*****@*****.**>
 */
function getIntervalTypes($what = 'array', $selected = '')
{
    global $lng;
    $intervalTypes = array('y', 'm', 'd');
    if (!in_array($selected, $intervalTypes)) {
        $selected = '';
    }
    switch ($what) {
        case 'option':
            $returnval = '';
            foreach ($intervalTypes as $intervalFeeType) {
                $returnval .= makeoption($lng['panel']['intervalfee_type'][$intervalFeeType], $intervalFeeType, $selected);
            }
            break;
        case 'array':
        default:
            $returnval = $intervalTypes;
            break;
    }
    return $returnval;
}
Esempio n. 9
0
}
if (!empty($indays)) {
    $wheresql .= " AND s.createdate>'" . ($timestamp - 86400 * $indays) . "'";
}
if (!empty($outdays)) {
    $wheresql .= " AND s.createdate<'" . ($timestamp - 86400 * $outdays) . "'";
}
if (!submitcheck('barcsedit')) {
    $caidsarr = array('0' => lang('allcatalog')) + caidsarr($catalogs);
    $chidsarr = array('0' => lang('allchannel')) + chidsarr();
    $isatmarr = array('0' => lang('archive'), '1' => lang('attachment'));
    tabheader(lang('filtersubscribe') . viewcheck('viewdetail', $viewdetail, 'tbodyfilter') . '&nbsp; &nbsp; ' . strbutton('bfilter', 'filter0'), "?action=subscribes{$forwardstr}");
    trbasic(lang('subscribetype'), '', makeradio('isatm', $isatmarr, $isatm), '');
    echo "<tbody id=\"tbodyfilter\" style=\"display: " . (empty($viewdetail) ? 'none' : '') . "\">";
    trbasic(lang('belongcatalog'), 'caid', makeoption($caidsarr, $caid), 'select');
    trbasic(lang('archivechannel'), 'chid', makeoption($chidsarr, $chid), 'select');
    trbasic(lang('archivetitle'), 'subject', $subject);
    trrange(lang('purchasedate'), array('outdays', empty($outdays) ? '' : $outdays, '', '&nbsp; ' . lang('daybefore') . '&nbsp; -&nbsp; ', 5), array('indays', empty($indays) ? '' : $indays, '', '&nbsp; ' . lang('dayin'), 5));
    echo "</tbody>";
    tabfooter();
    $pagetmp = $page;
    do {
        $query = $db->query("SELECT s.*,a.* FROM {$tblprefix}subscribes s LEFT JOIN {$tblprefix}archives a ON a.aid=s.aid {$wheresql} ORDER BY s.id DESC LIMIT " . ($pagetmp - 1) * $mrowpp . ",{$mrowpp}");
        $pagetmp--;
    } while (!$db->num_rows($query) && $pagetmp);
    $itemstr = '';
    while ($item = $db->fetch_array($query)) {
        $id = $item['id'];
        $item['arcurl'] = view_arcurl($item);
        $item['createdate'] = date("{$dateformat}", $item['createdate']);
        $itemstr .= "<tr><td class=\"item\" width=\"40\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$id}]\" value=\"{$id}\"></td>\n" . "<td class=\"item2\"><a href=\"{$item['arcurl']}\" target=\"_blank\">" . mhtmlspecialchars($item['subject']) . "</a></td>\n" . "<td class=\"item\" width=\"80\">" . $catalogs[$item['caid']]['title'] . "</td>\n" . "<td class=\"item\" width=\"80\">" . ($item['isatm'] ? 'Y' : '-') . "</td>\n" . "<td class=\"item\" width=\"80\">{$item['cridstr']}</td>\n" . "<td class=\"item\" width=\"70\">{$item['createdate']}</td></tr>\n";
Esempio n. 10
0
     echo "<select style=\"vertical-align: middle;\" name=\"areply\">" . makeoption($areplyarr, $areply) . "</select>&nbsp; ";
 }
 //栏目搜索
 if (in_array('catalog', $u_filters)) {
     $caidsarr = array('0' => lang('catalog')) + caidsarr($catalogs);
     echo "<select style=\"vertical-align: middle;\" name=\"caid\">" . makeoption($caidsarr, $caid) . "</select>&nbsp; ";
 }
 foreach ($ucotypes as $k => $v) {
     //报价类系的搜索
     if (in_array('uccid' . $k, $u_filters) && $v['cclass'] == 'reply') {
         $ucoclasses = read_cache('ucoclasses', $k);
         $uccidsarr = array();
         foreach ($ucoclasses as $k1 => $v2) {
             $uccidsarr[$k1] = $v1['title'];
         }
         echo "<select style=\"vertical-align: middle;\" name=\"uccid{$k}\">" . makeoption($uccidsarr, empty(${"uccid{$k}"}) ? 0 : ${"uccid{$k}"}) . "</select>&nbsp; ";
     }
 }
 echo strbutton('bfilter', 'filter0') . '</td></tr>';
 tabfooter();
 $pagetmp = $page;
 do {
     $query = $db->query("SELECT cu.*,cu.createdate AS ucreatedate,a.sid,a.createdate,a.caid,a.chid,a.customurl,a.subject AS asubject {$fromsql} {$wheresql} ORDER BY cu.refreshdate DESC LIMIT " . ($pagetmp - 1) * $mrowpp . ",{$mrowpp}");
     $pagetmp--;
 } while (!$db->num_rows($query) && $pagetmp);
 tabheader(empty($u_mtitle) ? lang('replylist') : $u_mtitle, '', '', 30);
 $cy_arr = array("<input class=\"checkbox\" type=\"checkbox\" name=\"chkall\" onclick=\"checkall(this.form, 'selectid', 'chkall')\">", lang('title'), lang('member'));
 if (in_array('catalog', $u_lists)) {
     $cy_arr[] = lang('catalog');
 }
 if (in_array('channel', $u_lists)) {
Esempio n. 11
0
/**
 * checks if the new-version has some updating to do
 *
 * @param boolean $has_preconfig   pointer to check if any preconfig has to be output
 * @param string  $return          pointer to output string
 * @param string  $current_version current froxlor version
 *
 * @return null
 */
function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version)
{
    global $lng;
    if (versionInUpdate($current_version, '0.9.4-svn2')) {
        $has_preconfig = true;
        $description = 'Froxlor now enables the usage of a domain-wildcard entry and subdomains for this domain at the same time (subdomains are parsed before the main-domain vhost container).';
        $description .= 'This makes it possible to catch all non-existing subdomains with the main vhost but also have the ability to use subdomains for that domain.<br />';
        $description .= 'If you would like Froxlor to do so with your domains, the update script can set the correct values for existing domains for you. Note: future domains will have wildcard-entries enabled by default no matter how you decide here.';
        $question = '<strong>Do you want to use wildcard-entries for existing domains?:</strong>&nbsp;';
        $question .= makeyesno('update_domainwildcardentry', '1', '0', '1');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.6-svn2')) {
        if (!PHPMailer::ValidateAddress(Settings::Get('panel.adminmail'))) {
            $has_preconfig = true;
            $description = 'Froxlor uses a newer version of the phpMailerClass and determined that your current admin-mail address is invalid.';
            $question = '<strong>Please specify a new admin-email address:</strong>&nbsp;<input type="text" class="text" name="update_adminmail" value="' . Settings::Get('panel.adminmail') . '" />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.6-svn3')) {
        $has_preconfig = true;
        $description = 'You now have the possibility to define default error-documents for your webserver which replace the default webserver error-messages.';
        $question = '<strong>Do you want to enable default error-documents?:</strong>&nbsp;';
        $question .= makeyesno('update_deferr_enable', '1', '0', '0') . '<br /><br />';
        if (Settings::Get('system.webserver') == 'apache2') {
            $question .= 'Path/URL for error 500:&nbsp;<input type="text" class="text" name="update_deferr_500" /><br /><br />';
            $question .= 'Path/URL for error 401:&nbsp;<input type="text" class="text" name="update_deferr_401" /><br /><br />';
            $question .= 'Path/URL for error 403:&nbsp;<input type="text" class="text" name="update_deferr_403" /><br /><br />';
        }
        $question .= 'Path/URL for error 404:&nbsp;<input type="text" class="text" name="update_deferr_404" />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.6-svn4')) {
        $has_preconfig = true;
        $description = 'You can define a default support-ticket priority level which is pre-selected for new support-tickets.';
        $question = '<strong>Which should be the default ticket-priority?:</strong>&nbsp;';
        $question .= '<select name="update_deftic_priority">';
        $priorities = makeoption($lng['ticket']['high'], '1', '2');
        $priorities .= makeoption($lng['ticket']['normal'], '2', '2');
        $priorities .= makeoption($lng['ticket']['low'], '3', '2');
        $question .= $priorities . '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.6-svn5')) {
        $has_preconfig = true;
        $description = 'If you have more than one PHP configurations defined in Froxlor you can now set a default one which will be used for every domain.';
        $question = '<strong>Select default PHP configuration:</strong>&nbsp;';
        $question .= '<select name="update_defsys_phpconfig">';
        $configs_array = getPhpConfigs();
        $configs = '';
        foreach ($configs_array as $idx => $desc) {
            $configs .= makeoption($desc, $idx, '1');
        }
        $question .= $configs . '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.6-svn6')) {
        $has_preconfig = true;
        $description = 'For the new FTP-quota feature, you can now chose the currently used ftpd-software.';
        $question = '<strong>Used FTPd-software:</strong>&nbsp;';
        $question .= '<select name="update_defsys_ftpserver">';
        $question .= makeoption('ProFTPd', 'proftpd', 'proftpd');
        $question .= makeoption('PureFTPd', 'pureftpd', 'proftpd');
        $question .= '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.7-svn1')) {
        $has_preconfig = true;
        $description = 'You can now choose whether customers can select the http-redirect code and which of them acts as default.';
        $question = '<strong>Allow customer chosen redirects?:</strong>&nbsp;';
        $question .= makeyesno('update_customredirect_enable', '1', '0', '1') . '<br /><br />';
        $question .= '<strong>Select default redirect code (default: empty):</strong>&nbsp;';
        $question .= '<select name="update_customredirect_default">';
        $redirects = makeoption('--- (' . $lng['redirect_desc']['rc_default'] . ')', 1, '1');
        $redirects .= makeoption('301 (' . $lng['redirect_desc']['rc_movedperm'] . ')', 2, '1');
        $redirects .= makeoption('302 (' . $lng['redirect_desc']['rc_found'] . ')', 3, '1');
        $redirects .= makeoption('303 (' . $lng['redirect_desc']['rc_seeother'] . ')', 4, '1');
        $redirects .= makeoption('307 (' . $lng['redirect_desc']['rc_tempred'] . ')', 5, '1');
        $question .= $redirects . '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.7-svn2')) {
        $result = Database::query("SELECT `domain` FROM " . TABLE_PANEL_DOMAINS . " WHERE `documentroot` LIKE '%:%' AND `documentroot` NOT LIKE 'http://%' AND `openbasedir_path` = '0' AND `openbasedir` = '1'");
        $wrongOpenBasedirDomain = array();
        while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
            $wrongOpenBasedirDomain[] = $row['domain'];
        }
        if (count($wrongOpenBasedirDomain) > 0) {
            $has_preconfig = true;
            $description = 'Resetting the open_basedir to customer - root';
            $question = '<strong>Due to a security - issue regarding open_basedir, Froxlor will set the open_basedir for the following domains to the customers root instead of the chosen documentroot:</strong><br />&nbsp;';
            $question .= '<ul>';
            $idna_convert = new idna_convert_wrapper();
            foreach ($wrongOpenBasedirDomain as $domain) {
                $question .= '<li>' . $idna_convert->decode($domain) . '</li>';
            }
            $question .= '</ul>';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.9-svn1')) {
        $has_preconfig = true;
        $description = 'When entering MX servers to Froxlor there was no mail-, imap-, pop3- and smtp-"A record" created. You can now chose whether this should be done or not.';
        $question = '<strong>Do you want these A-records to be created even with MX servers given?:</strong>&nbsp;';
        $question .= makeyesno('update_defdns_mailentry', '1', '0', '0');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.10-svn1')) {
        $has_nouser = false;
        $has_nogroup = false;
        $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'");
        $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
        if (!isset($result) || !isset($result['value'])) {
            $has_preconfig = true;
            $has_nouser = true;
            $guessed_user = '******';
            if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {
                $_httpuser = posix_getpwuid(posix_getuid());
                $guessed_user = $_httpuser['name'];
            }
        }
        $result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'");
        $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
        if (!isset($result) || !isset($result['value'])) {
            $has_preconfig = true;
            $has_nogroup = true;
            $guessed_group = 'www-data';
            if (function_exists('posix_getgid') && function_exists('posix_getgrgid')) {
                $_httpgroup = posix_getgrgid(posix_getgid());
                $guessed_group = $_httpgroup['name'];
            }
        }
        if ($has_nouser || $has_nogroup) {
            $description = 'Please enter the correct username/groupname of the webserver on your system We\'re guessing the user but it might not be correct, so please check.';
            if ($has_nouser) {
                $question = '<strong>Please enter the webservers username:</strong>&nbsp;<input type="text" class="text" name="update_httpuser" value="' . $guessed_user . '" />';
            } elseif ($has_nogroup) {
                $question2 = '<strong>Please enter the webservers groupname:</strong>&nbsp;<input type="text" class="text" name="update_httpgroup" value="' . $guessed_group . '" />';
                if ($has_nouser) {
                    $question .= '<br /><br />' . $question2;
                } else {
                    $question = $question2;
                }
            }
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.10')) {
        $has_preconfig = true;
        $description = 'you can now decide whether Froxlor should be reached via hostname/froxlor or directly via the hostname.';
        $question = '<strong>Do you want Froxlor to be reached directly via the hostname?:</strong>&nbsp;';
        $question .= makeyesno('update_directlyviahostname', '1', '0', '0');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.11-svn1')) {
        $has_preconfig = true;
        $description = 'It is possible to enhance security with setting a regular expression to force your customers to enter more complex passwords.';
        $question = '<strong>Enter a regular expression to force a higher password complexity (leave empty for none):</strong>&nbsp;';
        $question .= '<input type="text" class="text" name="update_pwdregex" value="" />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.11-svn3')) {
        $has_preconfig = true;
        $description = 'As Froxlor can now handle perl, you have to specify where the perl executable is (only if you\'re running lighttpd, else just leave empty).';
        $question = '<strong>Path to perl (default \'/usr/bin/perl\'):</strong>&nbsp;';
        $question .= '<input type="text" class="text" name="update_perlpath" value="/usr/bin/perl" />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.12-svn1')) {
        if (Settings::Get('system.mod_fcgid') == 1) {
            $has_preconfig = true;
            $description = 'You can chose whether you want Froxlor to use FCGID itself too now.';
            $question = '<strong>Use FCGID for the Froxlor Panel?:</strong>&nbsp;';
            $question .= makeyesno('update_fcgid_ownvhost', '1', '0', '0') . '<br /><br />';
            $question .= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
            $question .= 'Local user:&nbsp;';
            $question .= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />';
            $question .= 'Local group:&nbsp;';
            $question .= '<input type="text" class="text" name="update_fcgid_httpgroup" value="froxlorlocal" /><br />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.12-svn2')) {
        $has_preconfig = true;
        $description = 'Many apache user will have problems using perl/CGI as the customer docroots are not within the suexec path. Froxlor provides a simple workaround for that.';
        $question = '<strong>Enable Apache/SuExec/Perl workaround?:</strong>&nbsp;';
        $question .= makeyesno('update_perl_suexecworkaround', '1', '0', '0') . '<br /><br />';
        $question .= '<strong>If \'yes\', please specify a path within the suexec path where Froxlor will create symlinks to customer perl-enabled paths:</strong><br /><br />';
        $question .= 'Path for symlinks (must be within suexec path):&nbsp;';
        $question .= '<input type="text" class="text" name="update_perl_suexecpath" value="/var/www/cgi-bin/" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.12-svn4')) {
        if ((int) Settings::Get('system.awstats_enabled') == 1) {
            $has_preconfig = true;
            $description = 'Due to different paths of awstats_buildstaticpages.pl and awstats.pl you can set a different path for awstats.pl now.';
            $question = '<strong>Path to \'awstats.pl\'?:</strong>&nbsp;';
            $question .= '<input type="text" class="text" name="update_awstats_awstatspath" value="' . Settings::Get('system.awstats_path') . '" /><br />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.13-svn1')) {
        if ((int) Settings::Get('autoresponder.autoresponder_active') == 1) {
            $has_preconfig = true;
            $description = 'Froxlor can now limit the number of autoresponder-entries for each user. Here you can set the value which will be available for each customer (Of course you can change the value for each customer separately after the update).';
            $question = '<strong>How many autoresponders should your customers be able to add?:</strong>&nbsp;';
            $question .= '<input type="text" class="text" name="update_autoresponder_default" value="0" />&nbsp;' . makecheckbox('update_autoresponder_default', $lng['customer']['unlimited'], '-1', false, 0, true, true) . '<br />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.13.1')) {
        if ((int) Settings::Get('system.mod_fcgid_ownvhost') == 1) {
            $has_preconfig = true;
            $description = 'You have FCGID for Froxlor itself activated. You can now specify a PHP-configuration for this.';
            $question = '<strong>Select Froxlor-vhost PHP configuration:</strong>&nbsp;';
            $question .= '<select name="update_defaultini_ownvhost">';
            $configs_array = getPhpConfigs();
            $configs = '';
            foreach ($configs_array as $idx => $desc) {
                $configs .= makeoption($desc, $idx, '1');
            }
            $question .= $configs . '</select>';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.14-svn3')) {
        if ((int) Settings::Get('system.awstats_enabled') == 1) {
            $has_preconfig = true;
            $description = 'To have icons in AWStats statistic-pages please enter the path to AWStats icons folder.';
            $question = '<strong>Path to AWSTats icons folder:</strong>&nbsp;';
            $question .= '<input type="text" class="text" name="update_awstats_icons" value="' . Settings::Get('system.awstats_icons') . '" />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.14-svn4')) {
        if ((int) Settings::Get('system.use_ssl') == 1) {
            $has_preconfig = true;
            $description = 'Froxlor now has the possibility to set \'SSLCertificateChainFile\' for the apache webserver.';
            $question = '<strong>Enter filename (leave empty for none):</strong>&nbsp;';
            $question .= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="' . Settings::Get('system.ssl_cert_chainfile') . '" />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.14-svn6')) {
        $has_preconfig = true;
        $description = 'You can now allow customers to use any of their domains as username for the login.';
        $question = '<strong>Do you want to enable domain-login for all customers?:</strong>&nbsp;';
        $question .= makeyesno('update_allow_domain_login', '1', '0', '0');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.14-svn10')) {
        $has_preconfig = true;
        $description = '<strong>This update removes the unsupported real-time option. Additionally the deprecated tables for navigation and cronscripts are removed, any modules using these tables need to be updated to the new structure!</strong>';
        $question = '';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.16-svn1')) {
        $has_preconfig = true;
        $description = 'Froxlor now features support for php-fpm.';
        $question = '<strong>Do you want to enable php-fpm?:</strong>&nbsp;';
        $question .= makeyesno('update_phpfpm_enabled', '1', '0', '0') . '<br /><br />';
        $question .= 'If \'yes\', please specify the configuration directory:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_configdir" value="/etc/php-fpm.d/" /><br /><br />';
        $question .= 'Please specify the temporary files directory:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_tmpdir" value="/var/customers/tmp/" /><br /><br />';
        $question .= 'Please specify the PEAR directory:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_peardir" value="/usr/share/php/:/usr/share/php5/" /><br /><br />';
        $question .= 'Please specify the php-fpm restart-command:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_reload" value="/etc/init.d/php-fpm restart" /><br /><br />';
        $question .= 'Please specify the php-fpm rocess manager control:&nbsp;';
        $question .= '<select name="update_phpfpm_pm">';
        $redirects = makeoption('static', 'static', 'static');
        $redirects .= makeoption('dynamic', 'dynamic', 'static');
        $question .= $redirects . '</select><br /><br />';
        $question .= 'Please specify the number of child processes:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_max_children" value="1" /><br /><br />';
        $question .= 'Please specify the number of requests per child before respawning:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_max_requests" value="0" /><br /><br />';
        $question .= '<em>The following settings are only required if you chose process manager = dynamic</em><br /><br />';
        $question .= 'Please specify the number of child processes created on startup:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_start_servers" value="20" /><br /><br />';
        $question .= 'Please specify the desired minimum number of idle server processes:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_min_spare_servers" value="5" /><br /><br />';
        $question .= 'Please specify the desired maximum number of idle server processes:&nbsp;';
        $question .= '<input type="text" class="text" name="update_phpfpm_max_spare_servers" value="35" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.16-svn2')) {
        if ((int) Settings::Get('phpfpm.enabled') == 1) {
            $has_preconfig = true;
            $description = 'You can chose whether you want Froxlor to use PHP-FPM itself too now.';
            $question = '<strong>Use PHP-FPM for the Froxlor Panel?:</strong>&nbsp;';
            $question .= makeyesno('update_phpfpm_enabled_ownvhost', '1', '0', '0') . '<br /><br />';
            $question .= '<strong>If \'yes\', please specify local user/group (have to exist, Froxlor does not add them automatically):</strong><br /><br />';
            $question .= 'Local user:&nbsp;';
            $question .= '<input type="text" class="text" name="update_phpfpm_httpuser" value="' . Settings::Get('system.mod_fcgid_httpuser') . '" /><br /><br />';
            $question .= 'Local group:&nbsp;';
            $question .= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="' . Settings::Get('system.mod_fcgid_httpgroup') . '" /><br />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.17-svn1')) {
        $has_preconfig = true;
        $description = 'Select if you want to enable the web- and traffic-reports';
        $question = '<strong>Enable?:</strong>&nbsp;';
        $question .= makeyesno('update_system_report_enable', '1', '0', '1') . '<br /><br />';
        $question .= '<strong>If \'yes\', please specify a percentage value for web- and traffic when reports are to be sent:</strong><br /><br />';
        $question .= 'Webusage warning level:&nbsp;';
        $question .= '<input type="text" class="text" name="update_system_report_webmax" value="90" /><br /><br />';
        $question .= 'Traffic warning level:&nbsp;';
        $question .= '<input type="text" class="text" name="update_system_report_trafficmax" value="90" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.18-svn2')) {
        $has_preconfig = true;
        $description = 'As you can (obviously) see, Froxlor now comes with a new theme. You also have the possibility to switch back to "Classic" if you want to.';
        $question = '<strong>Select default panel theme:</strong>&nbsp;';
        $question .= '<select name="update_default_theme">';
        $themes = getThemes();
        foreach ($themes as $cur_theme) {
            $question .= makeoption($cur_theme, $cur_theme, 'Froxlor');
        }
        $question .= '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.28-svn4')) {
        $has_preconfig = true;
        $description = 'This version introduces a lot of profound changes:';
        $description .= '<br /><ul><li>Improving the whole template system</li><li>Full UTF-8 support</li><li><strong>Removing support for the former default theme \'Classic\'</strong></li></ul>';
        $description .= '<br /><br />Notice: This update will <strong>alter your Froxlor database to use UTF-8</strong> as default charset. ';
        $description .= 'Even though this is already tested, we <span class="red">strongly recommend</span> to ';
        $description .= 'test this update in a testing environment using your existing data.<br /><br />';
        $question = '<strong>Select your preferred Classic Theme replacement:</strong>&nbsp;';
        $question .= '<select name="classic_theme_replacement">';
        $themes = getThemes();
        foreach ($themes as $cur_theme) {
            $question .= makeoption($cur_theme, $cur_theme, 'Froxlor');
        }
        $question .= '</select>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.28-svn6')) {
        if (Settings::Get('system.webserver') == 'apache2') {
            $has_preconfig = true;
            $description = 'Froxlor now supports the new Apache 2.4. Please be aware that you need to load additional apache-modules in ordner to use it.<br />';
            $description .= '<pre>LoadModule authz_core_module modules/mod_authz_core.so
					LoadModule authz_host_module modules/mod_authz_host.so</pre><br />';
            $question = '<strong>Do you want to enable the Apache-2.4 modification?:</strong>&nbsp;';
            $question .= makeyesno('update_system_apache24', '1', '0', '0');
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        } elseif (Settings::Get('system.webserver') == 'nginx') {
            $has_preconfig = true;
            $description = 'The path to nginx\'s fastcgi_params file is now customizable.<br /><br />';
            $question = '<strong>Please enter full path to you nginx/fastcgi_params file (including filename):</strong>&nbsp;';
            $question .= '<input type="text" class="text" name="nginx_fastcgi_params" value="/etc/nginx/fastcgi_params" />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.28-rc2')) {
        $has_preconfig = true;
        $description = 'This version adds an option to append the domain-name to the document-root for domains and subdomains.<br />';
        $description .= 'You can enable or disable this feature anytime from settings -> system settings.<br />';
        $question = '<strong>Do you want to automatically append the domain-name to the documentroot of newly created domains?:</strong>&nbsp;';
        $question .= makeyesno('update_system_documentroot_use_default_value', '1', '0', '0');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.28')) {
        $has_preconfig = true;
        // just an information about the new sendmail parameter (#1134)
        $description = 'Froxlor changed the default parameter-set of sendmail (php.ini)<br />';
        $description .= 'sendmail_path = "/usr/sbin/sendmail -t <strong>-i</strong> -f {CUSTOMER_EMAIL}"<br /><br />';
        $description .= 'If you don\'t have any problems with sending mails, you don\'t need to change this';
        if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
            // information about removal of php's safe_mode
            $description .= '<br /><br />The php safe_mode flag has been removed as current versions of PHP<br />';
            $description .= 'do not support it anymore.<br /><br />';
            $description .= 'Please check your php-configurations and remove safe_mode-directives to avoid php notices/warnings.';
        }
        $question = '';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.29-dev1')) {
        // we only need to ask if fcgid|php-fpm is enabled
        if (Settings::Get('system.mod_fcgid') == '1' || Settings::Get('phpfpm.enabled') == '1') {
            $has_preconfig = true;
            $description = 'Standard-subdomains can now be hidden from the php-configuration overview.<br />';
            $question = '<strong>Do you want to hide the standard-subdomains (this can be changed in the settings any time)?:</strong>&nbsp;';
            $question .= makeyesno('hide_stdsubdomains', '1', '0', '0');
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.29-dev2')) {
        $has_preconfig = true;
        $description = 'You can now decide whether admins/customers are able to change the theme<br />';
        $question = '<strong>If you want to disallow theme-changing, select "no" from the dropdowns:</strong>&nbsp;';
        $question .= "Admins: " . makeyesno('allow_themechange_a', '1', '0', '1') . '&nbsp;&nbsp;';
        $question .= "Customers: " . makeyesno('allow_themechange_c', '1', '0', '1');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.29-dev3')) {
        $has_preconfig = true;
        $description = 'There is now a possibility to specify AXFR servers for your bind zone-configuration<br />';
        $question = '<strong>Enter a comma-separated list of AXFR servers or leave empty (default):</strong>&nbsp;';
        $question .= '<input type="text" class="text" name="system_afxrservers" value="" />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.29-dev4')) {
        $has_preconfig = true;
        $description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored<br />';
        $question = '<strong>Specify the directory for customer ssl-certificates:</strong>&nbsp;';
        $question .= '<input type="text" class="text" name="system_customersslpath" value="/etc/ssl/froxlor-custom/" />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.29.1-dev3')) {
        $has_preconfig = true;
        $description = 'The build in logrotation-feature has been removed. Please follow the configuration-instructions for your system to enable logrotating again.';
        $question = '';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    // let the apache+fpm users know that they MUST change their config
    // for the domains / webserver to work after the update
    if (versionInUpdate($current_version, '0.9.30-dev1')) {
        if (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled') == '1') {
            $has_preconfig = true;
            $description = 'The PHP-FPM implementation for apache2 has changed. Please look for the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) within /etc/apache2/ and change it as shown below:<br /><br />';
            $description .= '<pre class="code-block">&lt;IfModule mod_fastcgi.c&gt;
    FastCgiIpcDir /var/lib/apache2/fastcgi/
    &lt;Location "/fastcgiphp"&gt;
        Order Deny,Allow
        Deny from All
        # Prevent accessing this path directly
        Allow from env=REDIRECT_STATUS
    &lt;/Location&gt;
&lt;/IfModule&gt;</pre>';
            $question = '';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.31-dev2')) {
        if (Settings::Get('system.webserver') == 'apache2' && Settings::Get('phpfpm.enabled') == '1') {
            $has_preconfig = true;
            $description = 'The FPM socket directory is now a setting in froxlor. Its default is <b>/var/lib/apache2/fastcgi/</b>.<br/>If you are using <b>/var/run/apache2</b> in the "<b>fastcgi.conf</b>" (Debian/Ubuntu) or "<b>70_fastcgi.conf</b>" (Gentoo) please correct this path accordingly<br />';
            $question = '';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.31-dev4')) {
        $has_preconfig = true;
        $description = 'The template-variable {PASSWORD} has been replaced with {LINK}. Please update your password reset templates!<br />';
        $question = '';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.31-dev5')) {
        $has_preconfig = true;
        $description = 'You can enable/disable error-reporting for admins and customers!<br /><br />';
        $question = '<strong>Do you want to enable error-reporting for admins? (default: yes):</strong>&nbsp;';
        $question .= makeyesno('update_error_report_admin', '1', '0', '1') . '<br />';
        $question .= '<strong>Do you want to enable error-reporting for customers? (default: no):</strong>&nbsp;';
        $question .= makeyesno('update_error_report_customer', '1', '0', '0');
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.31-rc2')) {
        $has_preconfig = true;
        $description = 'You can enable/disable the display/usage of the news-feed for admins<br /><br />';
        $question = '<strong>Do you want to enable the news-feed for admins? (default: yes):</strong>&nbsp;';
        $question .= makeyesno('update_admin_news_feed', '1', '0', '1') . '<br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.32-dev2')) {
        $has_preconfig = true;
        $description = 'To enable logging of the mail-traffic, you need to set the following settings accordingly<br /><br />';
        $question = '<strong>Do you want to enable the traffic collection for mail? (default: yes):</strong>&nbsp;';
        $question .= makeyesno('mailtraffic_enabled', '1', '0', '1') . '<br />';
        $question .= '<strong>Mail Transfer Agent</strong><br />';
        $question .= 'Type of your MTA:&nbsp;';
        $question .= '<select name="mtaserver">';
        $question .= makeoption('Postfix', 'postfix', 'postfix');
        $question .= makeoption('Exim4', 'exim4', 'postfix');
        $question .= '</select><br />';
        $question .= 'Logfile for your MTA:&nbsp;';
        $question .= '<input type="text" class="text" name="mtalog" value="/var/log/mail.log" /><br />';
        $question .= '<strong>Mail Delivery Agent</strong><br />';
        $question .= 'Type of your MDA:&nbsp;';
        $question .= '<select name="mdaserver">';
        $question .= makeoption('Dovecot', 'dovecot', 'dovecot');
        $question .= makeoption('Courier', 'courier', 'dovecot');
        $question .= '</select><br /><br />';
        $question .= 'Logfile for your MDA:&nbsp;';
        $question .= '<input type="text" class="text" name="mdalog" value="/var/log/mail.log" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.32-dev5')) {
        $has_preconfig = true;
        $description = 'Froxlor now generates a cron-configuration file for the cron-daemon. Please set a filename which will be included automatically by your crond (e.g. files in /etc/cron.d/)<br /><br />';
        $question = '<strong>Path to the cron-service configuration-file.</strong> This file will be updated regularly and automatically by froxlor.<br />Note: please <b>be sure</b> to use the same filename as for the main froxlor cronjob (default: /etc/cron.d/froxlor)!<br />';
        $question .= '<input type="text" class="text" name="crondfile" value="/etc/cron.d/froxlor" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.32-dev6')) {
        $has_preconfig = true;
        $description = 'In order for the new cron.d file to work properly, we need to know about the cron-service reload command.<br /><br />';
        $question = '<strong>Please specify the reload-command of your cron-daemon</strong> (default: /etc/init.d/cron reload)<br />';
        $question .= '<input type="text" class="text" name="crondreload" value="/etc/init.d/cron reload" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.32-rc2')) {
        $has_preconfig = true;
        $description = 'To customize the command which executes the cronjob (php - basically) change the path below according to your system.<br /><br />';
        $question = '<strong>Please specify the command to execute cronscripts</strong> (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")<br />';
        $question .= '<input type="text" class="text" name="croncmdline" value="/usr/bin/nice -n 5 /usr/bin/php5 -q" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.33-dev1')) {
        $has_preconfig = true;
        $description = 'You can enable/disable the display/usage of the custom newsfeed for customers.<br /><br />';
        $question = '<strong>Do you want to enable the custom newsfeed for customer? (default: no):</strong>&nbsp;';
        $question .= makeyesno('customer_show_news_feed', '1', '0', '0') . '<br />';
        $question .= '<strong>You have to set the URL for your RSS-feed here, if you have chosen to enable the custom newsfeed on the customer-dashboard:</strong>&nbsp;';
        $question .= '<input type="text" class="text" name="customer_news_feed_url" value="" /><br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.33-dev2')) {
        // only if bind is used - if not the default will be set, which is '0' (off)
        if (Settings::get('system.bind_enable') == 1) {
            $has_preconfig = true;
            $description = 'You can enable/disable the generation of the bind-zone / config for the system hostname.<br /><br />';
            $question = '<strong>Do you want to generate a bind-zone for the system-hostname? (default: no):</strong>&nbsp;';
            $question .= makeyesno('dns_createhostnameentry', '1', '0', '0') . '<br />';
            eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
        }
    }
    if (versionInUpdate($current_version, '0.9.33-rc2')) {
        $has_preconfig = true;
        $description = 'You can chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes.<br /><br />';
        $question = '<strong>Do you want to receive cron-errors via mail? (default: no):</strong>&nbsp;';
        $question .= makeyesno('system_send_cron_errors', '1', '0', '0') . '<br />';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
    if (versionInUpdate($current_version, '0.9.34-dev3')) {
        $has_preconfig = true;
        $description = 'Froxlor now requires the PHP mbstring-extension as we need to be multibyte-character safe in some cases';
        $question = '<strong>PHP mbstring</strong> is currently: ';
        if (!extension_loaded('mbstring')) {
            $question .= '<span class="red">not installed/loaded</span>';
            $question .= '<br>Please install the PHP mbstring extension in order to finish the update';
        } else {
            $question .= '<span class="green">installed/loaded</span>';
        }
        $question .= '<br>';
        eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";");
    }
}
Esempio n. 12
0
    trbasic(lang('arr_pre'), 'mtagnew[setting][val]', empty($mtag['setting']['val']) ? 'v' : $mtag['setting']['val'], 'text', lang('agarr_pre'));
    trbasic(lang('list_result'), 'mtagnew[setting][limits]', empty($mtag['setting']['limits']) ? '10' : $mtag['setting']['limits']);
    $arr = array('archives' => lang('archive'), 'members' => lang('member'), 'farchives' => lang('freeinfo'), 'catalogs' => lang('catalog'), 'coclass' => lang('coclass'), 'offers' => lang('offer'), 'replys' => lang('reply'), 'comments' => lang('comment'), 'mcfields' => lang('mcomment'), 'mrfields' => lang('mreply'));
    echo "<tr class=\"txt\"><td class=\"txt txtright fB borderright\">" . lang('vote_type') . "</td>\n";
    echo "<td class=\"txtL\">\n";
    echo "<input class=\"radio\" type=\"radio\" name=\"mtagnew[setting][type]\" value=\"\" onclick=\"\$id('vote_type1').style.display = '';\$id('vote_type2').style.display = 'none';\"" . (empty($mtag['setting']['type']) ? ' checked' : '') . ">" . lang('freevote') . "\n";
    $i = 1;
    foreach ($arr as $k => $v) {
        echo "<input class=\"radio\" type=\"radio\" name=\"mtagnew[setting][type]\" value=\"{$k}\" onclick=\"\$id('vote_type1').style.display = 'none';\$id('vote_type2').style.display = '';\"" . (@$mtag['setting']['type'] == $k ? ' checked' : '') . ">{$v}\n";
        echo $i % 6 ? '' : '<br>';
        $i++;
    }
    echo "</td></tr>\n";
    echo "<tbody id=\"vote_type1\" style=\"display:" . (empty($mtag['setting']['type']) ? '' : 'none') . "\">";
    $sourcearr = array('0' => lang('nolimit_coclass')) + vcaidsarr();
    trbasic(lang('vote_coclass_limited'), 'mtagnew[setting][vsource]', makeoption($sourcearr, empty($mtag['setting']['vsource']) ? '0' : $mtag['setting']['vsource']), 'select');
    trbasic(lang('vote_id_limited'), 'mtagnew[setting][vids]', empty($mtag['setting']['vids']) ? '' : $mtag['setting']['vids']);
    echo "</tbody>";
    echo "<tbody id=\"vote_type2\" style=\"display:" . (!empty($mtag['setting']['type']) ? '' : 'none') . "\">";
    trbasic(lang('soucerid'), 'mtagnew[setting][id]', isset($mtag['setting']['id']) ? $mtag['setting']['id'] : '', 'text');
    trbasic(lang('soucefname'), 'mtagnew[setting][fname]', isset($mtag['setting']['fname']) ? $mtag['setting']['fname'] : '', 'text');
    echo "</tbody>";
    trbasic(lang('tagjspick'), 'mtagnew[setting][js]', empty($mtag['setting']['js']) ? 0 : $mtag['setting']['js'], 'radio');
    tabfooter();
} else {
    $mtagnew['setting']['fname'] = trim($mtagnew['setting']['fname']);
    if (empty($mtagnew['template'])) {
        if (!submitcheck('bmtagcode')) {
            amessage('input_tag_tpl', M_REFERER);
        } else {
            $errormsg = lang('input_tag_tpl');
Esempio n. 13
0
    public function _checkboxGroup($attr)
    {
        $tag = $this->parseXmlAttr($attr, 'checkboxGroup');
        $name = $tag['name'];
        //表单名称[name]
        $id = !empty($tag['id']) ? $tag['id'] : $tag['name'];
        //表单ID[id]//没值则用NAME为值
        $value = $tag['value'];
        //表单[value]//没值则
        $class = empty($tag['class']) ? $tag['class'] : '';
        //表单class//没值则用NAME为值
        $style = empty($tag['style']) ? $tag['style'] : '';
        //表单[style]//没值则
        $disabled = $tag['disabled'] == 1 ? 'disabled' : '';
        //表单[disabled]//没值则
        $readonly = $tag['readonly'] == 1 ? 'readonly' : '';
        //表单[readonly]//没值则
        $othervar = $tag['othervar'];
        //表单[othervar]//没值则
        $outtable = $tag['outtable'];
        //表单[outtable]//没值则
        $outkey = $tag['outkey'];
        //表单[outkey]//没值则
        $outfield = $tag['outfield'];
        //表单[outfield]//没值则
        $outcondition = $tag['outcondition'];
        //表单[outcondition]//没值则
        $outorder = $tag['outorder'];
        //表单[outorder]//没值则
        $outadd = $tag['outadd'];
        //表单[outadd]//没值则
        if (!empty($outtable)) {
            if ($outtable == 'array') {
                $optionval = explode(',', $outfield);
                if (!empty($outkey)) {
                    $optionkey = explode(',', $outkey);
                    $options = array_combine($optionkey, $optionval);
                } else {
                    $options = $optionval;
                }
                $parseStr = '<?php  $options=array(';
                foreach ($options as $key => $val) {
                    $parseStr .= '"' . $key . '" => "' . $val . '", ';
                }
                $parseStr .= '); ?>';
            } else {
                $options = makeoption($outtable, $outkey, $outcondition, $outfield, $outorder, $outadd);
                $parseStr .= '<?php  $options=makeoption("' . $outtable . '","' . $outkey . '","' . $outcondition . '","' . $outfield . '","' . $outorder . '","' . $outadd . '"); ?>';
            }
        }
        $parseStr .= '<?php 
		 $value="' . $value . '";//写入相应的值
		 $tmpvale=explode(",",$value);//看看是不是多选的值,以","号为分隔
		if(count($tmpvale)>1){ $value=$tmpvale; }else{ $value=$value; } ?>';
        if (!empty($options)) {
            $parseStr .= '<?php  foreach($options as $key=>$val) { ?>';
            if (!empty($value)) {
                $parseStr .= '<?php if($value== $key  || in_array($key,$value) ) { ?>';
                $parseStr .= '<label><input id="' . $id . '_tmpval" name="' . $name . '_tmpval" type="checkbox"  value="<?php echo $key ?>" checked="checked" onchange="' . $name . 'updatevalue();" /><?php echo $val ?></label> ';
                $parseStr .= '<?php }else { ?><label><input id="' . $id . '_tmpval" name="' . $name . '_tmpval" type="checkbox"  value="<?php echo $key ?>"  onchange="' . $name . 'updatevalue();" /><?php echo $val ?></label> ';
                $parseStr .= '<?php } ?>';
            } else {
                $parseStr .= '<label><input id="' . $id . '_tmpval" name="' . $name . '_tmpval" type="checkbox"  value="<?php echo $key ?>"  onchange="' . $name . 'updatevalue();" /><?php echo $val ?></label>';
            }
            $parseStr .= '<?php } ?>';
        }
        $parseStr .= '
	 <input type="hidden" value="' . $value . '"  id="' . $id . '" name="' . $name . '">
	 <script  type="text/javascript">
function ' . $name . 'updatevalue(){
var s = document.getElementsByName("' . $name . '_tmpval");
var treuval = document.getElementsByName("' . $name . '");
var s2 = "";
for( var i = 0; i < s.length; i++ )
{
if ( s[i].checked ){
s2 += s[i].value+",";
}
}
s2 = s2.substr(0,s2.length-1);
treuval.value=s2;
//alert(treuval.value);
}
</script>';
        return $parseStr;
    }
Esempio n. 14
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (empty($commu['uconfig'])) {
    if ($action == 'commudetail') {
        if (empty($submitmode)) {
            trbasic(lang('operate_permi_set'), 'communew[setting][apmid]', makeoption(pmidsarr('cuadd'), empty($commu['setting']['apmid']) ? 0 : $commu['setting']['apmid']), 'select');
            trbasic(lang('nouservote'), 'communew[setting][nouservote]', isset($commu['setting']['nouservote']) ? $commu['setting']['nouservote'] : 0, 'radio');
            trbasic(lang('repeatvote'), 'communew[setting][repeatvote]', isset($commu['setting']['repeatvote']) ? $commu['setting']['repeatvote'] : 0, 'radio');
            trbasic(lang('answer_minlength'), 'communew[setting][minlength]', isset($commu['setting']['minlength']) ? $commu['setting']['minlength'] : 0);
            trbasic(lang('answer_maxlength'), 'communew[setting][maxlength]', isset($commu['setting']['maxlength']) ? $commu['setting']['maxlength'] : 0);
            trbasic(lang('item_ava_days'), 'communew[setting][vdays]', isset($commu['setting']['vdays']) ? $commu['setting']['vdays'] : 0);
            trbasic(lang('reward_currency_type'), 'communew[setting][crid]', makeoption(cridsarr(), isset($commu['setting']['crid']) ? $commu['setting']['crid'] : 0), 'select');
            trbasic(lang('allow_reward_mini_cu'), 'communew[setting][mini]', isset($commu['setting']['mini']) ? $commu['setting']['mini'] : 0);
            trbasic(lang('allow_reward_max_cu'), 'communew[setting][max]', isset($commu['setting']['max']) ? $commu['setting']['max'] : 0);
            trbasic(lang('credit_val_reward_cu'), 'communew[setting][credit]', isset($commu['setting']['credit']) ? $commu['setting']['credit'] : 0);
            tabfooter();
            tabheader(lang('advsetting') . "&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"checkbox\" type=\"checkbox\" name=\"viewdetail2\" value=\"1\" onclick=\"alterview('advsetting')\">" . lang('view'));
            echo "<tbody id=\"advsetting\" style=\"display: none;\">";
            trbasic(lang('custom_ucadd'), 'communew[ucadd]', empty($commu['ucadd']) ? '' : $commu['ucadd'], 'text', lang('agmucustom'));
            trbasic(lang('custom_ucvote'), 'communew[ucvote]', empty($commu['ucvote']) ? '' : $commu['ucvote'], 'text', lang('agmucustom'));
            trbasic(lang('custom_uadetail'), 'communew[uadetail]', empty($commu['uadetail']) ? '' : $commu['uadetail'], 'text', lang('agmucustom'));
            trbasic(lang('custom_umdetail'), 'communew[umdetail]', empty($commu['umdetail']) ? '' : $commu['umdetail'], 'text', lang('agmucustom'));
            trbasic(lang('customsetting'), 'communew[usetting]', empty($commu['usetting']) ? '' : $commu['usetting'], 'btextarea', lang('agcustomsetting'));
            echo "</tbody>";
        } else {
            if (empty($communew['setting']['crid'])) {
                amessage('choose_reward_cutype', axaction(2, M_REFERER));
            }
            $communew['setting']['minlength'] = max(0, intval($communew['setting']['minlength']));
            $communew['setting']['maxlength'] = max(0, intval($communew['setting']['maxlength']));
Esempio n. 15
0
         $s_arr = array();
         if (empty($u_operates) || in_array('readd', $u_operates)) {
             $s_arr['readd'] = lang('readd');
         }
         if (empty($u_operates) || in_array('delete', $u_operates)) {
             $s_arr['delete'] = lang('delete');
         }
         if ($s_arr) {
             $soperatestr = '';
             foreach ($s_arr as $k => $v) {
                 $soperatestr .= "<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[{$k}]\" value=\"1\">{$v} &nbsp;";
             }
             trbasic(lang('choose_item'), '', $soperatestr, '');
         }
         if (empty($u_operates) || in_array('uclass', $u_operates)) {
             trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[ucid]\" value=\"1\">&nbsp;" . lang('set') . lang('mycoclass'), 'arcucid', makeoption(array('0' => lang('cancelcoclass')) + $ucidsarr), 'select');
         }
         tabfooter('barcsedit');
         m_guide(@$u_guide);
     } else {
         include M_ROOT . $u_tplname;
     }
 } else {
     if (empty($arcdeal) && empty($itemsnew)) {
         mcmessage('selectopeitem', M_REFERER);
     }
     if (empty($selectid)) {
         mcmessage('conoffer', M_REFERER);
     }
     $uedit = new cls_cuedit();
     foreach ($selectid as $cid) {
Esempio n. 16
0
        $actuser->updatedb();
        $c_upload->closure(1, $mid, 'members');
        $c_upload->saveuptotal(1);
        adminlog(lang('detail_edit_member'));
        amessage('membermodifyfinish', M_REFERER);
    }
} elseif ($action == 'grouptype' && $mid) {
    if (!submitcheck('bmemberdetail')) {
        $a_field = new cls_field();
        $submitstr = '';
        tabheader(lang('usergroup_msg') . '&nbsp;:&nbsp;[' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=grouptype&mid={$mid}", 4, 1, 1);
        foreach ($grouptypes as $gtid => $grouptype) {
            if ($grouptype['mode'] < 2 && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($backamember || $gtid != 2)) {
                $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? '' : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']);
                $ugidsarr = array('0' => lang('release_usergroup')) + ugidsarr($grouptype['gtid'], $mchid);
                echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\"><select style=\"vertical-align: middle;\" name=\"minfosnew[grouptype" . $gtid . "]\">" . makeoption($ugidsarr, $actuser->info['grouptype' . $gtid]) . "</select></td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\"><input type=\"text\" size=\"20\" id=\"minfosnew[grouptype" . $gtid . "date]\" name=\"minfosnew[grouptype" . $gtid . "date]\" value=\"" . $actuser->info['grouptype' . $gtid . 'date'] . "\" onclick=\"ShowCalendar(this.id);\"></td>\n" . "</tr>";
            } else {
                $usergroups = read_cache('usergroups', $gtid);
                $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? lang('noend') : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']);
                echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\">" . (!$actuser->info['grouptype' . $gtid] ? lang('notbelong_usergroup') : $usergroups[$actuser->info['grouptype' . $gtid]]['cname']) . "</td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\">" . $actuser->info['grouptype' . $gtid . 'date'] . "</td>\n" . "</tr>";
            }
        }
        tabfooter('bmemberdetail');
        check_submit_func($submitstr);
        a_guide('memberdetail');
    } else {
        foreach ($grouptypes as $gtid => $grouptype) {
            if ($grouptype['mode'] < 2 && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($gtid != 2 || $backamember)) {
                $minfosnew['grouptype' . $gtid . 'date'] = !$minfosnew['grouptype' . $gtid] || !isdate($minfosnew['grouptype' . $gtid . 'date']) ? '0' : strtotime($minfosnew['grouptype' . $gtid . 'date']);
                $actuser->handgrouptype($gtid, $minfosnew['grouptype' . $gtid], $minfosnew['grouptype' . $gtid . 'date']);
            }
Esempio n. 17
0
             exit;
         }
         if (empty($_sys) && ($html = template('login', $temparr))) {
             mexit($html);
         } else {
             include_once M_ROOT . "./include/cheader.inc.php";
             _header(lang('memberlogin'));
             $cookiedef = '1m';
             $cookiearr = array('0' => lang('inbrowser'), '1h' => '1' . lang('hours'), '1d' => '1' . lang('days'), '1w' => '1' . lang('weeks'), '1m' => '1' . lang('month'), '-1' => lang('saveforever'));
             echo '<form name="cmslogin" id="cmslogin" method="post" action="?forward=' . rawurlencode($forward) . ($infloat ? "&infloat={$infloat}&handlekey={$handlekey}" : '') . '" onsubmit="return checklogin(this)">';
             tabheader_e();
             echo '<tr class="header"><td colspan="2"><b>' . lang('memberlogin') . '&nbsp; &nbsp; >><a href="tools/lostpwd.php"' . (empty($infloat) ? '' : " onclick=\"return floatwin('open_{$handlekey}',this)\"") . '>' . lang('getpwd') . '</a></b></td></tr>';
             trbasic(lang('membercname'), 'username');
             trbasic(lang('loginpwd'), 'password', '', 'password');
             tr_regcode('login');
             trbasic('Cookie', 'expires', makeoption($cookiearr, $cookiedef), 'select');
             trhidden('client_t', '');
             $infloat && trhidden('infloat', 1);
             tabfooter('cmslogin', lang('login'));
             mexit('</div></body></html>');
         }
     }
 } else {
     switch (empty($expires) ? '0' : strtolower($expires)) {
         case '-1':
             $expires = 3650 * 86400;
             break;
         case '1m':
             $expires = 30 * 86400;
             break;
         case '1w':
Esempio n. 18
0
                $valid_from = validate($_POST['valid_from'], html_entity_decode($lng['service']['valid_from']), '/^(19|20)\\d\\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
                $valid_to = validate($_POST['valid_to'], html_entity_decode($lng['service']['valid_to']), '/^(19|20)\\d\\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', ''));
                if (isset($taxclasses[$_POST['taxclass']])) {
                    $taxclass = $_POST['taxclass'];
                } else {
                    $taxclass_keys = array_keys($taxclasses);
                    $taxclass = $taxclass_keys[0];
                    unset($taxclass_keys);
                }
                $interval_fee = doubleval(str_replace(',', '.', $_POST['interval_fee']));
                $interval_length = intval($_POST['interval_length']);
                $interval_type = in_array($_POST['interval_type'], getIntervalTypes('array')) ? $_POST['interval_type'] : 'm';
                $interval_payment = intval($_POST['interval_payment']);
                $setup_fee = doubleval(str_replace(',', '.', $_POST['setup_fee']));
                if ($interval_payment != '1') {
                    $interval_payment = '0';
                }
                $db->query('UPDATE `' . TABLE_BILLING_SERVICE_DOMAINS_TEMPLATES . '` SET `valid_from` = \'' . $db->escape($valid_from) . '\', `valid_to` = \'' . $db->escape($valid_to) . '\', `interval_fee` = \'' . $db->escape($interval_fee) . '\', `interval_length` = \'' . $db->escape($interval_length) . '\', `interval_type` = \'' . $db->escape($interval_type) . '\', `interval_payment` = \'' . $db->escape($interval_payment) . '\', `setup_fee` = \'' . $db->escape($setup_fee) . '\', `taxclass` = \'' . $db->escape($taxclass) . '\' WHERE `id` = \'' . $id . '\' ');
                redirectTo($filename, array('s' => $s));
            } else {
                $interval_type = getIntervalTypes('option', $result['interval_type']);
                $interval_payment = makeoption($lng['service']['interval_payment_prepaid'], '0', $result['interval_payment'], true) . makeoption($lng['service']['interval_payment_postpaid'], '1', $result['interval_payment'], true);
                $taxclasses_option = '';
                foreach ($taxclasses as $classid => $classname) {
                    $taxclasses_option .= makeoption($classname, $classid, $result['taxclass']);
                }
                eval('echo "' . getTemplate('billing/domains_templates_edit') . '";');
            }
        }
    }
}
Esempio n. 19
0
                     } catch (Exception $e) {
                         $mailerr_msg = $e->getMessage();
                         $_mailerror = true;
                     }
                     if ($_mailerror) {
                         $log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
                         standard_error('errorsendingmail', $userinfo['email']);
                     }
                     $mail->ClearAddresses();
                 }
                 redirectTo($filename, array('page' => $page, 's' => $s));
             }
         } else {
             $mysql_servers = '';
             foreach ($sql_root as $mysql_server => $mysql_server_details) {
                 $mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server);
             }
             #$sendinfomail = makeyesno('sendinfomail', '1', '0', '0');
             $mysql_add_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/mysql/formfield.mysql_add.php');
             if (!checkNitradoServiceLimit((int) $userinfo['customerid'], 'mysql', 'allow_external_access', '1')) {
                 unset($mysql_add_data['mysql_add']['sections']['section_a']['fields']['mysql_allow_external_access']);
             }
             $mysql_add_form = htmlform::genHTMLForm($mysql_add_data);
             $title = $mysql_add_data['mysql_add']['title'];
             $image = $mysql_add_data['mysql_add']['image'];
             eval("echo \"" . getTemplate("mysql/mysqls_add") . "\";");
         }
     }
 } elseif ($action == 'edit' && $id != 0) {
     $result = $db->query_first('SELECT `id`, `databasename`, `description`, `dbserver`, `allow_external_access` FROM `' . TABLE_PANEL_DATABASES . '` WHERE `customerid`="' . $userinfo['customerid'] . '" AND `id`="' . $id . '"');
     $db_server = $result['dbserver'];
Esempio n. 20
0
     ${$k} && ($filterstr .= "&{$k}=" . rawurlencode(${$k}));
 }
 $wheresql = "mid={$memberid} AND delstate!=2";
 $state != '*' && ($wheresql .= " AND state='{$state}'");
 $pmode != '*' && ($wheresql .= " AND paymode='{$pmode}'");
 if ($keyword) {
     $keyword = str_replace(array(' ', '*'), '%', addcslashes($keyword, '%_'));
     $wheresql .= " AND (mname LIKE '%" . $keyword . "%' OR ordersn LIKE '%" . $keyword . "%')";
 }
 if (!submitcheck('barcsedit')) {
     echo form_str($action . 'arcsedit', "?action=orders");
     tabheader_e();
     echo "<tr><td class=\"item2\">";
     echo lang('keyword') . "&nbsp; <input class=\"text\" name=\"keyword\" type=\"text\" value=\"{$keyword}\" style=\"vertical-align: middle;width:200px\">&nbsp; ";
     echo "<select style=\"vertical-align: middle;\" name=\"state\">" . makeoption($statearr, $state) . "</select>&nbsp; ";
     echo "<select style=\"vertical-align: middle;\" name=\"pmode\">" . makeoption($pmodearr, $pmode) . "</select>&nbsp; ";
     echo strbutton('bfilter', 'filter0') . '</td></tr>';
     tabfooter();
     $pagetmp = $page;
     do {
         $query = $db->query("SELECT * FROM {$tblprefix}orders WHERE {$wheresql} ORDER BY oid DESC LIMIT " . ($pagetmp - 1) * $mrowpp . ",{$mrowpp}");
         $pagetmp--;
     } while (!$db->num_rows($query) && $pagetmp);
     $strorder = '';
     while ($order = $db->fetch_array($query)) {
         $oid = $order['oid'];
         $statestr = $statearr[$order['state']];
         $order['createdate'] = date("{$dateformat}", $order['createdate']);
         $strorder .= "<tr>" . "<td class=\"item\" width=\"30\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$oid}]\" value=\"{$oid}\" /></td>\n" . "<td class=\"item2\">{$order['ordersn']}</td>\n" . "<td class=\"item\">{$order['tomname']}</td>\n" . "<td class=\"item\" width=\"60\">{$order['totalfee']}</td>\n" . "<td class=\"item\" width=\"60\">{$order['payed']}</td>\n" . "<td class=\"item\" width=\"100\">{$statestr}</td>\n" . "<td class=\"item\" width=\"100\">{$order['createdate']}</td>\n" . "<td class=\"item\" width=\"40\"><a href=\"?action=orders&oid={$order['oid']}\">" . lang('detail') . "</a></td></tr>\n";
     }
     $ordercount = $db->result_one("SELECT count(*) FROM {$tblprefix}orders WHERE {$wheresql}");
Esempio n. 21
0
                 $db->query('INSERT INTO `' . TABLE_FTP_USERS . "` (`customerid`, `username`, `password`, `homedir`, `login_enabled`, `uid`, `gid`) VALUES ('" . (int) $userinfo['customerid'] . "', '" . $db->escape($username) . "', ENCRYPT('" . $db->escape($password) . "'), '" . $db->escape($path) . "', 'y', '" . (int) $userinfo['guid'] . "', '" . (int) $userinfo['guid'] . "')");
                 $db->query('UPDATE `' . TABLE_FTP_GROUPS . "` SET `members`=CONCAT_WS(',',`members`,'" . $db->escape($username) . "') WHERE `customerid`='" . $userinfo['customerid'] . "' AND `gid`='" . (int) $userinfo['guid'] . "'");
                 //						$db->query("INSERT INTO `".TABLE_FTP_GROUPS."` (`customerid`, `groupname`, `gid`, `members`) VALUES ('".$userinfo['customerid']."', '$username', '$uid', '$username')");
                 $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . "` SET `ftps_used`=`ftps_used`+1, `ftp_lastaccountnumber`=`ftp_lastaccountnumber`+1 WHERE `customerid`='" . (int) $userinfo['customerid'] . "'");
                 //						$db->query("UPDATE `".TABLE_PANEL_SETTINGS."` SET `value`='$uid' WHERE settinggroup='ftp' AND varname='lastguid'");
                 $log->logAction(USR_ACTION, LOG_INFO, "added ftp-account '" . $username . ' (' . $path . ")'");
                 inserttask(5);
                 redirectTo($filename, array('page' => $page, 's' => $s));
             }
         } else {
             $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
             if ($settings['customer']['ftpatdomain'] == '1') {
                 $domains = '';
                 $result_domains = $db->query('SELECT `domain` FROM `' . TABLE_PANEL_DOMAINS . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "'");
                 while ($row_domain = $db->fetch_array($result_domains)) {
                     $domains .= makeoption($idna_convert->decode($row_domain['domain']), $row_domain['domain']);
                 }
             }
             eval('echo "' . getTemplate('ftp/accounts_add') . '";');
         }
     }
 } elseif ($action == 'edit' && $id != 0) {
     $result = $db->query_first('SELECT `id`, `username`, `homedir` FROM `' . TABLE_FTP_USERS . "` WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $id . "'");
     if (isset($result['username']) && $result['username'] != '') {
         if (isset($_POST['send']) && $_POST['send'] == 'send') {
             $password = validate($_POST['ftp_password'], 'password');
             if ($password == '') {
                 standard_error(array('stringisempty', 'mypassword'));
                 exit;
             } else {
                 $db->query('UPDATE `' . TABLE_FTP_USERS . "` SET `password`=ENCRYPT('" . $db->escape($password) . "') WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `id`='" . (int) $id . "'");
Esempio n. 22
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (!submitcheck('bmtagadd') && !submitcheck('bmtagsdetail') && !submitcheck('bmtagcode')) {
    templatebox(lang('tagtemplate'), 'mtagnew[template]', empty($mtag['template']) ? '' : $mtag['template'], 10, 110);
    trbasic(lang('arr_pre'), 'mtagnew[setting][val]', empty($mtag['setting']['val']) ? 'v' : $mtag['setting']['val'], 'text', lang('agarr_pre'));
    trbasic(lang('list_result'), 'mtagnew[setting][limits]', empty($mtag['setting']['limits']) ? '10' : $mtag['setting']['limits']);
    trbasic(lang('tagjspick'), 'mtagnew[setting][js]', empty($mtag['setting']['js']) ? 0 : $mtag['setting']['js'], 'radio');
    tabfooter();
    tabheader(lang('setting_list_item'));
    $sourcearr = array('0' => lang('all_space0_catalog'), '1' => lang('handpoint'));
    sourcemodule(lang('space0catalog') . "&nbsp;&nbsp;&nbsp;<input class=\"radio\" type=\"radio\" name=\"mtagnew[setting][listby]\" value=\"ca\"" . (empty($mtag['setting']['listby']) || $mtag['setting']['listby'] == 'ca' ? " checked" : "") . ">" . lang('list_item'), 'mtagnew[setting][casource]', $sourcearr, empty($mtag['setting']['casource']) ? '0' : $mtag['setting']['casource'], '1', 'mtagnew[setting][caids][]', mcaidsarr(), !empty($mtag['setting']['caids']) ? explode(',', $mtag['setting']['caids']) : array());
    $sourcearr = array('0' => lang('catalog_all_coclass'));
    trbasic(lang('uclass') . "&nbsp;&nbsp;&nbsp;<input class=\"radio\" type=\"radio\" name=\"mtagnew[setting][listby]\" value=\"uc\"" . (!empty($mtag['setting']['listby']) && $mtag['setting']['listby'] == 'uc' ? " checked" : "") . ">" . lang('list_item'), 'mtagnew[setting][ucsource]', makeoption($sourcearr, isset($mtag['setting']['ucsource']) ? $mtag['setting']['ucsource'] : '0'), 'select');
    tabfooter();
} else {
    if (empty($mtagnew['template'])) {
        if (!submitcheck('bmtagcode')) {
            amessage('input_tag_tpl', M_REFERER);
        } else {
            $errormsg = lang('input_tag_tpl');
        }
        //生成代码出错的提示信息
    }
    $mtagnew['setting']['limits'] = empty($mtagnew['setting']['limits']) ? 10 : max(0, intval($mtagnew['setting']['limits']));
    //数组参数的处理
    $idvars = array('caids');
    foreach ($idvars as $k) {
        if (empty($mtagnew['setting'][$k])) {
            unset($mtagnew['setting'][$k]);
        } else {
Esempio n. 23
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
load_cache('btagnames,channels,fchannels');
aheader();
$url_type = 'btags';
include 'urlsarr.inc.php';
url_nav(lang('originallogo'), $urlsarr, 'search');
$bclasses = array('common' => lang('common_message'), 'archive' => lang('archive_related'), 'cnode' => lang('catas_related'), 'freeinfo' => lang('freeinfo_related'), 'commu' => lang('commu_message'), 'member' => lang('member_related'), 'other' => lang('other'));
$datatypearr = array('text' => lang('text'), 'multitext' => lang('multitext'), 'htmltext' => lang('htmltext'), 'image' => lang('image_f'), 'images' => lang('images'), 'flash' => lang('flash'), 'flashs' => lang('flashs'), 'media' => lang('media'), 'medias' => lang('medias'), 'file' => lang('file_f'), 'files' => lang('files_f'), 'select' => lang('select'), 'mselect' => lang('mselect'), 'cacc' => lang('cacc'), 'date' => lang('date_f'), 'int' => lang('int'), 'float' => lang('float'), 'map' => lang('map'), 'vote' => lang('vote'));
tabheader(lang('search_initag'), 'btagsearch', '?entry=btagsearch');
trbasic(lang('tagid_inc_string'), 'bsearch[ename]', empty($bsearch['ename']) ? '' : $bsearch['ename']);
trbasic(lang('tagname_inc_string'), 'bsearch[cname]', empty($bsearch['cname']) ? '' : $bsearch['cname']);
trbasic(lang('tag_coclass'), 'bsearch[bclass]', makeoption(array('' => lang('nolimit')) + $bclasses, empty($bsearch['bclass']) ? '' : $bsearch['bclass']), 'select');
tabfooter('bbtagsearch', lang('search'));
if (submitcheck('bbtagsearch')) {
    $ename = trim(strtolower($bsearch['ename']));
    $cname = trim($bsearch['cname']);
    $bclass = trim($bsearch['bclass']);
    if (empty($ename) && empty($cname) && empty($bclass)) {
        amessage('inputsearchstring');
    }
    tabheader(lang('initag_search_result'), '', '', '8');
    trcategory(array(lang('sn'), lang('tagname'), array(lang('use_style') . '1', 'txtL'), array(lang('use_style') . '2', 'txtL'), array(lang('use_style') . '3', 'txtL'), lang('tagclass'), lang('detail_coclass'), lang('field_type')));
    $i = 1;
    foreach ($btagnames as $k => $v) {
        if ((!$ename || in_str($ename, $v['ename'])) && (!$cname || in_str($cname, $v['cname'])) && (!$bclass || $v['bclass'] == $bclass)) {
            $sclasses = array();
            if ($v['bclass'] == 'archive') {
                foreach ($channels as $chid => $channel) {
                    $sclasses[$chid] = $channel['cname'];
Esempio n. 24
0
 $forward = empty($forward) ? M_REFERER : $forward;
 $cnode = $db->fetch_one("SELECT * FROM {$tblprefix}cnodes WHERE cnid={$cnid}");
 foreach (array('tpls', 'wtpls', 'urls', 'statics', 'periods') as $var) {
     ${$var . 'arr'} = explode(',', $cnode[$var]);
 }
 if (!submitcheck('bcnodedetail')) {
     tabheader(lang('cnode_detail_set'), 'cnodedetail', "?entry={$entry}&action={$action}{$param_suffix}&cnid={$cnid}&forward=" . urlencode($forward));
     trbasic(lang('cnode_name'), '', cnode_cname($cnode['ename']), '');
     trbasic(lang('cnode_alias'), 'cnodenew[alias]', $cnode['alias']);
     trbasic(lang('cnode_url'), 'cnodenew[appurl]', $cnode['appurl'], 'btext', lang('agappurl'));
     for ($i = 0; $i <= $cnode['addnum']; $i++) {
         $pvar = $i ? lang('addp') . $i : lang('index');
         trbasic($pvar . lang('template'), 'tplsnew[]', makeoption(array('' => lang('noset')) + mtplsarr('cindex'), empty($tplsarr[$i]) ? '' : $tplsarr[$i]), 'select');
         trbasic($pvar . lang('wtemplate'), 'wtplsnew[]', makeoption(array('' => lang('noset')) + mtplsarr('wap'), empty($wtplsarr[$i]) ? '' : $wtplsarr[$i]), 'select');
         trbasic($pvar . lang('staticfomart'), 'urlsnew[]', empty($urlsarr[$i]) ? '' : $urlsarr[$i], 'btext', !$i ? lang('agcnstaticfomart') : '');
         trbasic($pvar . lang('ifstatic'), "staticsnew[{$i}]", makeoption(array(0 => lang('staticsys'), 1 => lang('keepdnc'), 2 => lang('create_static')), empty($staticsarr[$i]) ? 0 : $staticsarr[$i]), 'select');
         trbasic($pvar . lang('staticperiod'), 'periodsnew[]', empty($periodsarr[$i]) ? '' : $periodsarr[$i], 'text');
     }
     tabfooter('bcnodedetail');
     a_guide('cnodedetail');
 } else {
     $cnodenew['alias'] = trim(strip_tags($cnodenew['alias']));
     $cnodenew['appurl'] = trim($cnodenew['appurl']);
     $sqlstr = "alias='{$cnodenew['alias']}',appurl='{$cnodenew['appurl']}'";
     foreach (array('tpls', 'wtpls', 'urls', 'statics', 'periods') as $var) {
         $cnodenew[$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'});
         $sqlstr .= ",{$var}='{$cnodenew[$var]}'";
     }
     $db->query("UPDATE {$tblprefix}cnodes SET {$sqlstr} WHERE cnid={$cnid}");
     adminlog(lang('detail_catas_cnode'));
     updatecache('cnodes', '', $sid);
Esempio n. 25
0
<?php

(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (empty($commu['uconfig'])) {
    if ($action == 'commudetail') {
        if (empty($submitmode)) {
            global $rfields;
            load_cache('rfields');
            trbasic(lang('is_allowance_citem'), 'communew[allowance]', $commu['allowance'], 'radio');
            trbasic(lang('reply_autocheck'), 'communew[setting][autocheck]', isset($commu['setting']['autocheck']) ? $commu['setting']['autocheck'] : 0, 'radio');
            trbasic(lang('operate_permi_set'), 'communew[setting][apmid]', makeoption(pmidsarr('cuadd'), empty($commu['setting']['apmid']) ? 0 : $commu['setting']['apmid']), 'select');
            trbasic(lang('allow_repeat'), 'communew[setting][repeat]', isset($commu['setting']['repeat']) ? $commu['setting']['repeat'] : 0, 'radio');
            trbasic(lang('repeat_time_m'), 'communew[setting][repeattime]', isset($commu['setting']['repeattime']) ? $commu['setting']['repeattime'] : 0);
            trbasic(lang('nouservote'), 'communew[setting][nouservote]', isset($commu['setting']['nouservote']) ? $commu['setting']['nouservote'] : 0, 'radio');
            trbasic(lang('repeatvote'), 'communew[setting][repeatvote]', isset($commu['setting']['repeatvote']) ? $commu['setting']['repeatvote'] : 0, 'radio');
            $itemsarr = array();
            foreach ($ucotypes as $k => $v) {
                if ($v['cclass'] == $commu['cclass']) {
                    $itemsarr['uccid' . $k] = $v['cname'];
                }
            }
            foreach ($rfields as $k => $v) {
                $itemsarr[$k] = $v['cname'];
            }
            trbasic(lang('cu_citems') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkall_1\" onclick=\"checkall(this.form,'citemsnew','chkall_1')\">" . lang('selectall'), '', makecheckbox('citemsnew[]', $itemsarr, empty($commu['setting']['citems']) ? array() : explode(',', $commu['setting']['citems']), 5), '');
            trbasic(lang('cu_useredits') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkall_5\" onclick=\"checkall(this.form,'usereditsnew','chkall_5')\">" . lang('selectall'), '', makecheckbox('usereditsnew[]', $itemsarr, empty($commu['setting']['useredits']) ? array() : explode(',', $commu['setting']['useredits']), 5), '');
            tabfooter();
            tabheader(lang('udef_func') . "&nbsp;&nbsp;&nbsp;&nbsp;<input class=\"checkbox\" type=\"checkbox\" name=\"viewdetail\" value=\"1\" onclick=\"alterview('funcsetting')\">" . lang('view'));
            echo "<tbody id=\"funcsetting\" style=\"display: none;\">";
            trbasic(lang('php_func_code'), 'communew[func]', empty($commu['func']) ? '' : $commu['func'], 'btextarea');
            echo "</tbody>";
Esempio n. 26
0
    } else {
        $language_options = '';
        $default_lang = $settings['panel']['standardlanguage'];
        if ($userinfo['def_language'] != '') {
            $default_lang = $userinfo['def_language'];
        }
        while (list($language_file, $language_name) = each($languages)) {
            $language_options .= makeoption($language_name, $language_file, $default_lang, true);
        }
        eval("echo \"" . getTemplate("index/change_language") . "\";");
    }
} elseif ($page == 'change_theme') {
    if (isset($_POST['send']) && $_POST['send'] == 'send') {
        $theme = validate($_POST['theme'], 'theme');
        $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `customerid`='" . (int) $userinfo['customerid'] . "'");
        $db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `theme`='" . $db->escape($theme) . "' WHERE `hash`='" . $db->escape($s) . "'");
        $log->logAction(USR_ACTION, LOG_NOTICE, "changed default theme to '" . $theme . "'");
        redirectTo($filename, array('s' => $s));
    } else {
        $theme_options = '';
        $default_theme = $settings['panel']['default_theme'];
        if ($userinfo['theme'] != '') {
            $default_theme = $userinfo['theme'];
        }
        $themes_avail = getThemes();
        foreach ($themes_avail as $t) {
            $theme_options .= makeoption($t, $t, $default_theme, true);
        }
        eval("echo \"" . getTemplate("index/change_theme") . "\";");
    }
}
Esempio n. 27
0
<?php

if (!submitcheck('bmtagadd') && !submitcheck('bmtagsdetail') && !submitcheck('bmtagcode')) {
    templatebox(lang('tagtemplate'), 'mtagnew[template]', empty($mtag['template']) ? '' : $mtag['template'], 10, 110);
    trbasic(lang('arr_pre'), 'mtagnew[setting][val]', empty($mtag['setting']['val']) ? 'v' : $mtag['setting']['val'], 'text', lang('agarr_pre'));
    trbasic(lang('point_msg_id'), 'mtagnew[setting][aid]', empty($mtag['setting']['aid']) ? '' : $mtag['setting']['aid']);
    trbasic(lang('tplpermi_set'), 'mtagnew[setting][pmid]', makeoption(pmidsarr('tpl'), empty($mtag['setting']['pmid']) ? 0 : $mtag['setting']['pmid']), 'select', lang('agtplpermi_set'));
    trbasic(lang('tagjspick'), 'mtagnew[setting][js]', empty($mtag['setting']['js']) ? 0 : $mtag['setting']['js'], 'radio');
    tabfooter();
} else {
    if (empty($mtagnew['template'])) {
        if (!submitcheck('bmtagcode')) {
            amessage('input_tag_tpl', M_REFERER);
        } else {
            $errormsg = lang('input_tag_tpl');
        }
        //生成代码出错的提示信息
    }
    $mtagnew['setting']['aid'] = max(0, intval($mtagnew['setting']['aid']));
}
Esempio n. 28
0
            if (isset($_POST['change_webalizer']) && $_POST['change_webalizer'] == 'true') {
                if (CRYPT_STD_DES == 1) {
                    $saltfordescrypt = substr(md5(uniqid(microtime(), 1)), 4, 2);
                    $new_webalizer_password = crypt($new_password, $saltfordescrypt);
                } else {
                    $new_webalizer_password = crypt($new_password);
                }
                $db->query("UPDATE `" . TABLE_PANEL_HTPASSWDS . "` SET `password`='" . $db->escape($new_webalizer_password) . "' WHERE `customerid`='" . (int) $userinfo['customerid'] . "' AND `username`='" . $db->escape($userinfo['loginname']) . "'");
            }
            redirectTo($filename, array('s' => $s));
        }
    } else {
        eval("echo \"" . getTemplate("index/change_password") . "\";");
    }
} elseif ($page == 'change_language') {
    if (isset($_POST['send']) && $_POST['send'] == 'send') {
        $def_language = validate($_POST['def_language'], 'default language');
        if (isset($languages[$def_language])) {
            $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `def_language`='" . $db->escape($def_language) . "' WHERE `customerid`='" . (int) $userinfo['customerid'] . "'");
            $db->query("UPDATE `" . TABLE_PANEL_SESSIONS . "` SET `language`='" . $db->escape($def_language) . "' WHERE `hash`='" . $db->escape($s) . "'");
            $log->logAction(USR_ACTION, LOG_NOTICE, "changed default language to '" . $def_language . "'");
        }
        redirectTo($filename, array('s' => $s));
    } else {
        $language_options = '';
        while (list($language_file, $language_name) = each($languages)) {
            $language_options .= makeoption($language_name, $language_file, $userinfo['def_language'], true);
        }
        eval("echo \"" . getTemplate("index/change_language") . "\";");
    }
}
Esempio n. 29
0
            try {
                $bulk = new DomainBulkAction($file_name, $customerid);
                $result = $bulk->doImport($separator, $offset);
            } catch (Exception $e) {
                standard_error('domain_import_error', $e->getMessage());
            }
            // @FIXME find a way to display $result['notice'] here somehow,
            //        as it might be important if you've reached your maximum allocation of domains
            // update customer/admin counters
            updateCounters(false);
            $result_str = $result['imported'] . ' / ' . $result['all'];
            standard_success('domain_import_successfully', $result_str, array('filename' => $filename, 'action' => '', 'page' => 'domains'));
        } else {
            $customers = makeoption($lng['panel']['please_choose'], 0, 0, true);
            $result_customers_stmt = Database::prepare("\n\t\t\t\tSELECT `customerid`, `loginname`, `name`, `firstname`, `company`\n\t\t\t\tFROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC");
            $params = array();
            if ($userinfo['customers_see_all'] == '0') {
                $params['adminid'] = $userinfo['adminid'];
            }
            Database::pexecute($result_customers_stmt, $params);
            while ($row_customer = $result_customers_stmt->fetch(PDO::FETCH_ASSOC)) {
                $customers .= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
            }
            $domain_import_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/domains/formfield.domains_import.php');
            $domain_import_form = htmlform::genHTMLForm($domain_import_data);
            $title = $domain_import_data['domain_import']['title'];
            $image = $domain_import_data['domain_import']['image'];
            eval("echo \"" . getTemplate("domains/domains_import") . "\";");
        }
    }
}
Esempio n. 30
0
(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (!submitcheck('bmtagadd') && !submitcheck('bmtagsdetail') && !submitcheck('bmtagcode')) {
    templatebox(lang('tagtemplate'), 'mtagnew[template]', empty($mtag['template']) ? '' : $mtag['template'], 10, 110);
    trbasic(lang('arr_pre'), 'mtagnew[setting][val]', empty($mtag['setting']['val']) ? 'v' : $mtag['setting']['val'], 'text', lang('agarr_pre'));
    trbasic(lang('list_result'), 'mtagnew[setting][limits]', empty($mtag['setting']['limits']) ? 10 : $mtag['setting']['limits']);
    tabfooter();
    tabheader(lang('filter0_set'));
    $matidsarr = array();
    foreach ($matypes as $k => $v) {
        $matidsarr[$k] = $v['cname'];
        $imatid = $k;
    }
    trbasic(lang('pointmatype'), 'mtagnew[setting][matid]', makeoption($matidsarr, empty($mtag['setting']['matid']) ? '0' : $mtag['setting']['matid']), 'select');
    $orderbyarr = array('' => lang('nosetting'), 'createdate_desc' => lang('createdate_desc'), 'createdate_asc' => lang('createdate_asc'), 'refreshdate_desc' => lang('refreshdate_desc'));
    trbasic(lang('order'), 'mtagnew[setting][orderby]', makeoption($orderbyarr, empty($mtag['setting']['orderby']) ? '' : $mtag['setting']['orderby']), 'select');
    $createurl = "&nbsp; >><a href=\"?entry=liststr&tclass=marchives_{$imatid}\" target=\"_blank\">" . lang('create_str') . "</a>";
    trbasic(lang('order_str') . $createurl, 'mtagnew[setting][orderstr]', empty($mtag['setting']['orderstr']) ? '' : stripslashes($mtag['setting']['orderstr']), 'textarea');
    trbasic(lang('startno'), 'mtagnew[setting][startno]', empty($mtag['setting']['startno']) ? '' : $mtag['setting']['startno'], 'text', lang('agstartno'));
    $isfuncstr = "<br><input class=\"checkbox\" type=\"checkbox\" id=\"mtagnew[setting][isfunc]\" name=\"mtagnew[setting][isfunc]\"" . (empty($mtag['setting']['isfunc']) ? '' : ' checked') . ">" . lang('fromfunc');
    trbasic(lang('filter_sql_str') . $createurl . $isfuncstr, 'mtagnew[setting][wherestr]', empty($mtag['setting']['wherestr']) ? '' : $mtag['setting']['wherestr'], 'textarea');
    trbasic(lang('tagjspick'), 'mtagnew[setting][js]', empty($mtag['setting']['js']) ? 0 : $mtag['setting']['js'], 'radio');
    tabfooter();
} else {
    if (empty($mtagnew['template'])) {
        if (!submitcheck('bmtagcode')) {
            amessage('input_tag_tpl', M_REFERER);
        } else {
            $errormsg = lang('input_tag_tpl');
        }
        //生成代码出错的提示信息