/** * Function getPreConfig * * outputs various content before the update process * can be continued (askes for agreement whatever is being asked) * * @param string version * * @return string */ function getPreConfig($current_version) { $has_preconfig = false; $return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>'; include_once makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php'); parseAndOutputPreconfig($has_preconfig, $return, $current_version); $return .= '<br /><br />' . makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true); $return .= '</div>'; $return .= '<input type="hidden" name="update_preconfig" value="1" />'; if ($has_preconfig) { return $return; } else { return ''; } }
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); }
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true) { global $userinfo, $db, $s, $header, $footer, $lng; $hiddenparams = ''; if (is_array($params)) { foreach ($params as $field => $value) { $hiddenparams .= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n"; } } if (isset($lng['question'][$text])) { $text = $lng['question'][$text]; } if (isset($lng['question'][$chk_text])) { $chk_text = $lng['question'][$chk_text]; } if ($show_checkbox) { $checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true); } else { $checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n"; } $text = strtr($text, array('%s' => $targetname)); eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";"); exit; }
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); if (empty($submitmode)) { $coidsarr = array(); foreach ($cotypes as $k => $v) { if (!$v['self_reg']) { $coidsarr[$k] = $v['cname']; } } trbasic(lang('view_coids') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallcoids\" onclick=\"checkall(this.form,'coidsnew','chkallcoids')\">" . lang('selectall'), '', makecheckbox('coidsnew[]', $coidsarr, empty($aurl['setting']['coids']) ? array() : explode(',', $aurl['setting']['coids']), 5), ''); trbasic(lang('yes_arange') . lang('achannel') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallchids\" onclick=\"checkall(this.form,'chidsnew','chkallchids')\">" . lang('selectall'), '', makecheckbox('chidsnew[]', chidsarr(1), empty($aurl['setting']['chids']) ? array() : explode(',', $aurl['setting']['chids']), 5), '', lang('agnoselect')); trbasic(lang('no_arange') . lang('achannel') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallnochids\" onclick=\"checkall(this.form,'nochidsnew','chkallnochids')\">" . lang('selectall'), '', makecheckbox('nochidsnew[]', chidsarr(1), empty($aurl['setting']['nochids']) ? array() : explode(',', $aurl['setting']['nochids']), 5), '', lang('agnoselect')); } else { foreach (array('coids', 'chids', 'nochids') as $var) { $aurlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'}); } $aurlnew['url'] = "?entry=addpre&nauid={$auid}"; }
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); if (empty($submitmode)) { load_cache('fcatalogs'); tabfooter(); tabheader(lang('arangeset')); trbasic(lang('arange') . lang('coclass') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallcaids\" onclick=\"checkall(this.form,'caidsnew','chkallcaids')\">" . lang('selectall'), '', makecheckbox('caidsnew[]', fcaidsarr(), empty($murl['setting']['caids']) ? array() : explode(',', $murl['setting']['caids']), 5), '', lang('agnoselect')); tabfooter(); tabheader(lang('pageresult')); trbasic(lang('adm_title'), 'murlnew[mtitle]', $murl['mtitle'], 'text', lang('aga_title')); trbasic(lang('adm_guide'), 'murlnew[guide]', $murl['guide'], 'textarea', lang('aga_title')); $tnstr = "<input type=\"text\" size=\"25\" id=\"murlnew[tplname]\" name=\"murlnew[tplname]\" value=\"{$murl['tplname']}\"> \n\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"murlnew[onlyview]\" id=\"murlnew[onlyview]\" value=\"1\"" . (empty($murl['onlyview']) ? '' : ' checked') . ">" . lang('onlyview'); trbasic(lang('customapage'), '', $tnstr, '', lang('agcustomapage')); } else { foreach (array('caids') as $var) { $murlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'}); } $murlnew['url'] = "?action=farchiveadd&nmuid={$muid}"; }
tabfooter(); tabheader(lang('a_url')); $iuidsarr = array(); foreach ($inurls as $k => $v) { if (in_array($v['uclass'], array('adetail', 'inadd', 'content', 'load', 'setalbum', 'vol', 'comments', 'offers', 'replys', 'answers', 'purchases', 'reports', 'custom'))) { $iuidsarr[$k] = '<b>' . $v['cname'] . '</b> ' . $v['remark']; } } trbasic(lang('view_inurls'), '', makecheckbox('channelnew[iuids][]', $iuidsarr, empty($channel['iuids']) ? array() : explode(',', $channel['iuids']), 3), '', lang('agnoselect1')); $imuidsarr = array(); foreach ($inmurls as $k => $v) { if (in_array($v['uclass'], array('adetail', 'inadd', 'content', 'load', 'setalbum', 'vol', 'replys', 'answers', 'custom'))) { $imuidsarr[$k] = '<b>' . $v['cname'] . '</b> ' . $v['remark']; } } trbasic(lang('view_inmurls'), '', makecheckbox('channelnew[imuids][]', $imuidsarr, empty($channel['imuids']) ? array() : explode(',', $channel['imuids']), 3), '', lang('agnoselect1')); tabfooter(); tabheader(lang('astaticset')); $addnos = explode(',', $channel['addnos']); $statics = explode(',', $channel['statics']); $periods = explode(',', $channel['periods']); $novus = explode(',', $channel['novus']); for ($i = 0; $i <= $max_addno; $i++) { $pvar = $i ? lang('addp') . $i : lang('arcconpage'); $str = "<input type=\"text\" size=\"6\" id=\"channelnew[addnos][{$i}]\" name=\"channelnew[addnos][{$i}]\" value=\"" . @$addnos[$i] . "\" title=\"" . lang('addnoset') . "\"> "; $str .= "<select id=\"channelnew[statics][{$i}]\" name=\"channelnew[statics][{$i}]\">" . makeoption(array(0 => lang('staticsys'), 1 => lang('keepdnc'), 2 => lang('create_static')), @$statics[$i]) . "</select> "; $str .= "<input type=\"text\" size=\"2\" id=\"channelnew[periods][{$i}]\" name=\"channelnew[periods][{$i}]\" value=\"" . @$periods[$i] . "\" title=\"" . lang('staticperiod') . "\"> "; $str .= "<input class=\"checkbox\" type=\"checkbox\" id=\"channelnew[novus][{$i}]\" name=\"channelnew[novus][{$i}]\" value=\"1\" " . (empty($novus[$i]) ? '' : ' checked') . " title=\"" . lang('novu') . "\">"; trbasic($pvar . lang('setting'), '', $str, '', $i ? '' : lang('agaddnos')); } tabfooter('bchanneldetail');
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') . " <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>"; tabfooter(); tabheader(lang('advsetting') . " <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 {
$aurlstr .= ($aurlstr ? ',' : '') . $k . '-' . @$aurls[$k]['cname']; } } echo "<tr class=\"txt\">\n" . "<td class=\"txtC w30\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$mchid}]\" value=\"{$mchid}\"></td>\n" . "<td class=\"txtL\">{$title}</td>\n" . "<td class=\"txtC\">{$aurlstr}</td>\n" . "</tr>\n"; } tabfooter(); tabheader(lang('operate_item')); $enablearr = array('1' => lang('enable'), '0' => lang('cancel')); trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[enable]\" value=\"1\"> " . lang('enable') . lang('mnode'), '', makeradio('arcenable', $enablearr, 1), ''); $aurlsarr = array(); foreach ($aurls as $k => $v) { if (in_array($v['uclass'], array('members', 'memadd', 'mcomments', 'mreplys', 'mreports', 'marchives', 'mtrans', 'utrans', 'custom'))) { $aurlsarr[$k] = $k . '-<b>' . $v['cname'] . '</b>-' . $v['remark']; } } trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[auids]\" value=\"1\"> " . lang('set') . lang('aurl'), '', makecheckbox('arcauids[]', $aurlsarr, array(), 1), ''); tabfooter('bamconfigablock'); a_guide('amconfigablock'); } else { if (!empty($selectid)) { foreach ($selectid as $id) { if (!empty($arcdeal['enable'])) { if ($arcenable) { if (!isset($mnodes[$id])) { $mnodes[$id] = ''; } } else { unset($mnodes[$id]); } } if (!empty($arcdeal['auids'])) {
$ticket['lastreplier'] = $lng['ticket']['customer']; } if (strlen($ticket['subject']) > 20) { $ticket['subject'] = substr($ticket['subject'], 0, 17) . '...'; } eval("\$tickets.=\"" . getTemplate("tickets/archived_tickets") . "\";"); } } $priorities_options = makecheckbox('priority1', $lng['ticket']['high'], '1'); $priorities_options .= makecheckbox('priority2', $lng['ticket']['normal'], '2'); $priorities_options .= makecheckbox('priority3', $lng['ticket']['low'], '3'); $category_options = ''; $ccount = 0; $result = $db->query('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC'); while ($row = $db->fetch_array($result)) { $category_options .= makecheckbox('category' . $ccount, $row['name'], $row['id'], true); $ccount++; } $customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1'); $result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC"); while ($row_customer = $db->fetch_array($result_customers)) { $customers .= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']); } eval("echo \"" . getTemplate("tickets/archive") . "\";"); } } elseif ($action == 'view' && $id != 0) { $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed archived-ticket #" . $id); $ticket_replies = ''; $mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $id); $lastchange = date("d.m.Y H:i\\h", $mainticket->Get('lastchange')); $dt = date("d.m.Y H:i\\h", $mainticket->Get('dt'));
$nclasses = array_intersect($nclasses, array_keys($tagclass)); if (in_array($utclass, $nclasses) || $utclass == 'no_class' && empty($nclasses)) { $ttype = $tag['ttype']; $title = $tag['title']; $vieworder = $tag['vieworder']; $tag = read_cache($ttype, $tag['tname'], '', $sid); $tclassstr = fetch_class($ttype, $tag['tclass']); $title || ($title = $tag['cname']); echo "<tr class=\"txt\">" . "<td class=\"txtC w40\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[]\" value=\"{$key}\"></td>\n" . "<td class=\"txtL\"><input type=\"text\" size=\"30\" maxlength=\"30\" name=\"usualtagsnew[{$key}][title]\" value=\"" . mhtmlspecialchars($title) . "\"></td>\n" . "<td class=\"txtL\">" . mhtmlspecialchars($tag['cname']) . "</td>\n" . "<td class=\"txtL\">{$tclassstr}</td>\n" . "<td class=\"txtL\">" . tag_style($tag['ename'], $ttype) . "</td>\n" . "<td class=\"txtC w50\"><input type=\"text\" size=\"4\" name=\"usualtagsnew[{$key}][vieworder]\" value=\"{$vieworder}\"></td>\n" . "<td class=\"txtC w30\"><a href=\"?entry=mtags&action=mtagsdetail&ttype={$ttype}{$param_suffix}&tname={$tag['ename']}\" onclick=\"return floatwin('open_mtagsedit',this)\">" . lang('detail') . "</a></td>\n" . "</tr>\n"; } } tabfooter(); //操作区 tabheader(lang('operate_item')); trbasic(lang('choose_item'), '', "<input class=\"checkbox\" type=\"checkbox\" name=\"tagdeal[delete]\" value=\"1\"> " . lang('delete'), ''); trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"tagdeal[utclass]\" value=\"1\"> " . lang('set') . lang('usualtagclass'), '', makecheckbox('tagutclass[]', $tagclass), ''); tabfooter('busualtagsedit'); a_guide('usualtags_edit'); } else { if (!empty($selectid)) { foreach ($selectid as $key) { if (!empty($tagdeal['delete'])) { unset($usualtagsnew[$key], $usualtags[$key]); continue; } if (!empty($tagdeal['utclass'])) { $usualtags[$key]['class'] = empty($tagutclass) ? '' : implode(',', $tagutclass); } } } if (!empty($usualtagsnew)) {
if ($result['email_autoresponder'] == '-1') { $result['email_autoresponder'] = ''; } $ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true); if ($result['ftps'] == '-1') { $result['ftps'] = ''; } $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true); if ($result['tickets'] == '-1') { $result['tickets'] = ''; } $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true); if ($result['mysqls'] == '-1') { $result['mysqls'] = ''; } $number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, $result['aps_packages'], true, true); if ($result['aps_packages'] == '-1') { $result['aps_packages'] = ''; } $language_options = ''; while (list($language_file, $language_name) = each($languages)) { $language_options .= makeoption($language_name, $language_file, $result['def_language'], true); } $ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']); $ips = array(); $ipsandports = $db->query('SELECT `id`, `ip` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ORDER BY `ip`, `port` ASC'); while ($row = $db->fetch_array($ipsandports)) { if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $row['ip'] = '[' . $row['ip'] . ']'; } if (!in_array($row['ip'], $ips)) {
} elseif ($action == 'grouptypedetail' && $gtid) { $grouptype = $grouptypes[$gtid]; if (!submitcheck('bgrouptypedetail')) { tabheader(lang('edit_grouptype'), 'grouptypedetail', "?entry=grouptypes&action=grouptypedetail>id={$gtid}"); $modearr = array('0' => lang('user_handwork'), '1' => lang('admin_handwork'), '2' => lang('crbase'), '3' => lang('crex')); $cridsarr = array(0 => $grouptype['mode'] == 3 ? lang('cash') : lang('noset')) + cridsarr(); trbasic(lang('grouptype_name'), 'grouptypenew[cname]', $grouptype['cname']); if ($grouptype['issystem']) { trbasic(lang('deal_mode'), '', $modearr[$grouptype['mode']], ''); trbasic(lang('related_cutype'), '', $cridsarr[$grouptype['crid']], ''); } else { trbasic(lang('deal_mode'), 'grouptypenew[mode]', makeoption($modearr, $grouptype['mode']), 'select'); trbasic(lang('related_cutype'), 'grouptypenew[crid]', makeoption($cridsarr, $grouptype['crid']), 'select'); trbasic(lang('usergroup_alter_reset'), 'grouptypenew[allowance]', $grouptype['allowance'], 'radio'); } trbasic(lang('inchids_forbid_use'), '', makecheckbox('grouptypenew[mchids][]', mchidsarr(), !empty($grouptype['mchids']) ? explode(',', $grouptype['mchids']) : array(), 5), ''); tabfooter('bgrouptypedetail', lang('modify')); a_guide('grouptypedetail'); } else { $grouptypenew['mode'] = empty($grouptypenew['mode']) ? 0 : $grouptypenew['mode']; $grouptypenew['crid'] = empty($grouptypenew['crid']) ? 0 : $grouptypenew['crid']; if (empty($grouptypenew['cname']) || $grouptypenew['mode'] == 2 && empty($grouptypenew['crid'])) { amessage('groupdatamis', M_REFERER); } $grouptypenew['crid'] = $grouptypenew['mode'] < 2 ? 0 : $grouptypenew['crid']; $grouptypenew['mchids'] = !empty($grouptypenew['mchids']) ? implode(',', $grouptypenew['mchids']) : ''; $grouptypenew['allowance'] = empty($grouptypenew['allowance']) ? 0 : $grouptypenew['allowance']; $sqlstr = $grouptype['issystem'] ? '' : "mode='{$grouptypenew['mode']}',crid='{$grouptypenew['crid']}',allowance='{$grouptypenew['allowance']}',"; $db->query("UPDATE {$tblprefix}grouptypes SET \n\t\t\t\t\tcname='{$grouptypenew['cname']}',\n\t\t\t\t\t{$sqlstr}\n\t\t\t\t\tmchids='{$grouptypenew['mchids']}'\n\t\t\t\t\tWHERE gtid='{$gtid}'"); adminlog(lang('detail_modify_grouptype')); updatecache('grouptypes', $gtid);
/** * function provides package management for admins. */ private function ManagePackages() { global $lng, $filename, $s, $page, $action; $Question = false; if (isset($_POST['save'])) { if (isset($_POST['all']) && $_POST['all'] == 'lock') { //lock alle packages $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_LOCKED . ' WHERE 1'); } elseif (isset($_POST['all']) && $_POST['all'] == 'unlock') { //enable all packages $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_ENABLED . ' WHERE 1'); } elseif (isset($_POST['downloadallpackages'])) { $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_SYSTEM_DOWNLOAD); if ($this->db->num_rows($Result) > 0) { self::InfoBox($lng['aps']['downloadtaskexists']); } else { $this->db->query('INSERT INTO `' . TABLE_APS_TASKS . '` (`Task`, `InstanceID`) VALUES (' . TASK_SYSTEM_DOWNLOAD . ', 0)'); self::InfoBox($lng['aps']['downloadtaskinserted']); } } elseif (isset($_POST['updateallpackages'])) { $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_TASKS . '` WHERE `Task` = ' . TASK_SYSTEM_UPDATE); if ($this->db->num_rows($Result) > 0) { self::InfoBox($lng['aps']['updatetaskexists']); } else { $this->db->query('INSERT INTO `' . TABLE_APS_TASKS . '` (`Task`, `InstanceID`) VALUES (' . TASK_SYSTEM_UPDATE . ', 0)'); self::InfoBox($lng['aps']['updatetaskinserted']); } } elseif (isset($_POST['enablenewest'])) { //lock alle packages, then find newerst package and enable it $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_LOCKED); //get all packages $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` GROUP BY `Name`'); while ($Row = $this->db->fetch_array($Result)) { //get newest version of package $NewestVersion = ''; $NewestId = ''; $Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape($Row['Name']) . '"'); while ($Row2 = $this->db->fetch_array($Result2)) { if (version_compare($Row2['Version'] . '-' . $Row2['Release'], $NewestVersion) == 1) { $NewestVersion = $Row2['Version'] . '-' . $Row2['Release']; $NewestId = $Row2['ID']; } } //enable newest version $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_ENABLED . ' WHERE `ID` = ' . $NewestId); } } elseif (isset($_POST['removeunused'])) { //remove all packages which have no dependencies (count of package instances = 0) if (isset($_POST['answer']) && $_POST['answer'] == $lng['panel']['yes']) { //get all packages $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`'); while ($Row = $this->db->fetch_array($Result)) { //query how often package has been installed $Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` WHERE `PackageID` = ' . $Row['ID']); if ($this->db->num_rows($Result2) == 0) { //remove package if number of package instances is 0 self::UnlinkRecursive('./packages/' . $Row['Path']); $this->db->query('DELETE FROM `' . TABLE_APS_PACKAGES . '` WHERE `ID` = ' . $Row['ID']); } } } else { //show yes/no question $Message = $lng['question']['reallyremovepackages']; $Ids = '<input type="hidden" name="removeunused" value="1"/>'; eval('echo "' . getTemplate('aps/askyesno') . '";'); $Question = true; } } elseif (isset($_POST['all']) && $_POST['all'] == 'remove') { //remove all packages from system if (isset($_POST['answer']) && $_POST['answer'] == $lng['panel']['yes']) { $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`'); //check for dependencies while ($Row = $this->db->fetch_array($Result)) { //query how often package has been installed $Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` WHERE `PackageID` = ' . $Row['ID']); if ($this->db->num_rows($Result2) == 0) { //remove package if number of package instances is 0 self::UnlinkRecursive('./packages/' . $Row['Path']); $this->db->query('DELETE FROM `' . TABLE_APS_PACKAGES . '` WHERE `ID` = ' . $Row['ID']); } } } else { //show yes/no question $Message = $lng['question']['reallyremovepackages']; $Ids = '<input type="hidden" name="all" value="remove"/>'; eval('echo "' . getTemplate('aps/askyesno') . '";'); $Question = true; } } else { //no special button or "all" function has been clicked //continue to parse "single" options $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`'); $Ids = ''; while ($Row = $this->db->fetch_array($Result)) { //set new status of package (locked) if ($Row['Status'] == PACKAGE_ENABLED && isset($_POST['lock' . $Row['ID']])) { $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_LOCKED . ' WHERE `ID` = ' . $this->db->escape($Row['ID'])); } //set new status of package (enabled) if ($Row['Status'] == PACKAGE_LOCKED && isset($_POST['unlock' . $Row['ID']])) { $this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_ENABLED . ' WHERE `ID` = ' . $this->db->escape($Row['ID'])); } //save id of package to remove for yes/no question if (isset($_POST['remove' . $Row['ID']])) { $Ids .= '<input type="hidden" name="remove' . $Row['ID'] . '" value="1"/>'; //remove package if answer is yes if (isset($_POST['answer']) && $_POST['answer'] == $lng['panel']['yes']) { self::UnlinkRecursive('./packages/' . $Row['Path']); $this->db->query('DELETE FROM `' . TABLE_APS_PACKAGES . '` WHERE `ID` = ' . $Row['ID']); } } } //if there are some ids to remove, show yes/no box if ($Ids != '' && !isset($_POST['answer'])) { //show yes/no question $Message = $lng['question']['reallyremovepackages']; eval('echo "' . getTemplate('aps/askyesno') . '";'); $Question = true; } } } //show package overview with options if (!isset($_POST['save']) || $Question == false) { //query all packages grouped by package name $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` GROUP BY `Name` ORDER BY `Name` ASC'); $Packages = ''; while ($Row = $this->db->fetch_array($Result)) { eval('$Packages.="' . getTemplate('aps/manage_packages_row') . '";'); //get all package versions of current package $Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape($Row['Name']) . '" ORDER BY `Version` DESC, `Release` DESC'); while ($Row2 = $this->db->fetch_array($Result2)) { //show package with options $Lock = ''; $Unlock = ''; if ($Row2['Status'] == PACKAGE_ENABLED) { $Lock = makecheckbox('lock' . $Row2['ID'], '', '1'); } if ($Row2['Status'] == PACKAGE_LOCKED) { $Unlock = makecheckbox('unlock' . $Row2['ID'], '', '1'); } //query how often package has been installed $Result3 = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` WHERE `PackageID` = ' . $Row2['ID']); $Installations = $this->db->num_rows($Result3); if ($Installations == 0) { $Remove = makecheckbox('remove' . $Row2['ID'], '', '1'); } eval('$Packages.="' . getTemplate('aps/manage_packages_detail') . '";'); } } if ($this->db->num_rows($Result) == 0) { //no packages have been installed in system self::InfoBox($lng['aps']['nopackagesinsystem']); eval('echo "' . getTemplate('aps/manage_packages_download') . '";'); } else { //generate some statistics $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`'); $Temp = $this->db->num_rows($Result); $Statistics = sprintf($lng['aps']['numerofpackagesinstalled'], $this->db->num_rows($Result)); $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Status` = ' . PACKAGE_ENABLED); $Statistics .= sprintf($lng['aps']['numerofpackagesenabled'], $this->db->num_rows($Result)); $Statistics .= sprintf($lng['aps']['numerofpackageslocked'], $Temp - $this->db->num_rows($Result)); if ((int) $this->userinfo['customers_see_all'] == 1) { $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '`'); $Statistics .= sprintf($lng['aps']['numerofinstances'], $this->db->num_rows($Result)); } else { $Result = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` AS `i` INNER JOIN `' . TABLE_PANEL_CUSTOMERS . '` AS `c` ON `i`.`CustomerID` = `c`.`customerid` WHERE `c`.`adminid` = ' . (int) $this->userinfo['adminid']); $Statistics .= sprintf($lng['aps']['numerofinstances'], $this->db->num_rows($Result)); } eval('echo "' . getTemplate('aps/manage_packages') . '";'); } } }
$arr =& $matypes; $tvar = 'cname'; } elseif (in_str('ccid', $mcnvar)) { $arr = read_cache('coclasses', str_replace('ccid', '', $mcnvar)); $tvar = 'title'; } elseif (in_str('ugid', $mcnvar)) { $arr = read_cache('usergroups', str_replace('ugid', '', $mcnvar)); $tvar = 'cname'; } $narr = array(); foreach ($arr as $k => $v) { if (empty($mcnodes[$mcnvar . '=' . $k])) { $narr[$k] = $v[$tvar] . (isset($v['level']) ? '(' . $v['level'] . ')' : ''); } } trbasic(lang('choosenode') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallmcnids\" onclick=\"checkall(this.form,'mcnidsnew','chkallmcnids')\">" . lang('selectall'), '', makecheckbox('mcnidsnew[]', $narr, array(), 5), ''); } trbasic(lang('addnonum'), 'mcnodenew[addnum]'); trhidden('mcnodenew[mcnvar]', $mcnvar); tabfooter('bmcnodeadd', lang('add')); } } else { $mcnodenew['addnum'] = min(empty($mcn_max_addno) ? 0 : $mcn_max_addno, max(0, intval($mcnodenew['addnum']))); if ($mcnvar == 'mcnid') { if ($mcnodenew['alias'] = trim(strip_tags($mcnodenew['alias']))) { $db->query("INSERT INTO {$tblprefix}mcnodes SET alias='{$mcnodenew['alias']}',addnum='{$mcnodenew['addnum']}',mcnvar='{$mcnvar}'"); if ($cnid = $db->insert_id()) { $db->query("UPDATE {$tblprefix}mcnodes SET mcnid='{$cnid}',ename='{$mcnvar}={$cnid}' WHERE cnid={$cnid}"); } updatecache('mcnodes'); }
if ($date_from == -1) { $deactivated = '-1'; $date_from = ''; } else { $deactivated = '0'; $date_from = date('d-m-Y', $date_from); } $date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); if ($date_until == -1) { $deactivated = '-1'; $date_until = ''; } else { $deactivated = '0'; $date_until = date('d-m-Y', $date_until); } $date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); #$isactive = makeyesno('active', '1', '0', $row['enabled']); $autoresponder_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/autoresponder/formfield.autoresponder_edit.php'); $autoresponder_edit_form = htmlform::genHTMLForm($autoresponder_edit_data); $title = $autoresponder_edit_data['autoresponder_edit']['title']; $image = $autoresponder_edit_data['autoresponder_edit']['image']; eval("echo \"" . getTemplate("autoresponder/autoresponder_edit") . "\";"); } else { if ($action == "delete") { if (isset($_POST['send']) && $_POST['send'] == 'send') { $account = trim($_POST['account']); // Does autoresponder exist? $result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int) $userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1"); if ($db->num_rows($result) == 0) { standard_error('invalidautoresponder'); }
} } updatecache('coclasses', $coid); amessage('cocledifin', '?entry=coclass&action=coclassedit&coid=' . $coid); } } elseif ($action == 'coclassdetail' && $ccid) { $coclass = read_cache('coclass', $coid, $ccid); if (!submitcheck('bcoclassdetail')) { $ccidsarr = array('0' => lang('noset')); $submitstr = ''; tabheader(lang('coclass') . " [{$coclass['title']}] " . lang('base_setting'), 'coclassdetail', "?entry=coclass&action=coclassdetail&coid={$coid}&ccid={$ccid}", 2, 1, 1); trbasic(lang('coclass_ename'), 'coclassnew[dirname]', $coclass['dirname'], 'text', lang('agdirname')); trbasic(lang('parent_coclass'), 'coclassnew[pid]', makeoption(array('0' => lang('topiccoclass')) + ccidsarr($coid), $coclass['pid']), 'select'); trbasic(lang('isframe_coclass_i'), 'coclassnew[isframe]', $coclass['isframe'], 'radio'); if (empty($cotype['self_reg'])) { trbasic(lang('allow_channel_archive'), '', makecheckbox('coclassnew[chids][]', chidsarr(1), !empty($coclass['chids']) ? explode(',', $coclass['chids']) : array(), 5), ''); if ($cotype['permission']) { trbasic(lang('add_pmid'), 'coclassnew[apmid]', makeoption(pmidsarr('aadd'), $coclass['apmid']), 'select'); trbasic(lang('read_pmid'), 'coclassnew[rpmid]', makeoption(pmidsarr('aread'), $coclass['rpmid']), 'select'); trbasic(lang('cread_pmid'), 'coclassnew[crpmid]', makeoption(pmidsarr('cread'), $coclass['crpmid']), 'select'); trbasic(lang('down_pmid'), 'coclassnew[dpmid]', makeoption(pmidsarr('down'), $coclass['dpmid']), 'select'); } $cotype['awardcp'] && trbasic(lang('issue_arc_currency'), 'coclassnew[awardcp]', makeoption(array('' => lang('noaward')) + $vcps['award'], $coclass['awardcp']), 'select'); $cotype['taxcp'] && trbasic(lang('arc_deduct_currency'), 'coclassnew[taxcp]', makeoption(array('' => lang('freesale')) + $vcps['tax'], $coclass['taxcp']), 'select'); $cotype['ftaxcp'] && trbasic(lang('att_deduct_currency'), 'coclassnew[ftaxcp]', makeoption(array('' => lang('freesale')) + $vcps['ftax'], $coclass['ftaxcp']), 'select'); $cotype['sale'] && trbasic(lang('allow_sale_arc'), 'coclassnew[allowsale]', $coclass['allowsale'], 'radio'); $cotype['fsale'] && trbasic(lang('allow_sale_att'), 'coclassnew[allowfsale]', $coclass['allowfsale'], 'radio'); } tabfooter(); if (!empty($cotype['self_reg'])) { tabheader(lang('coclass') . " [{$coclass['title']}] " . lang('arc_acondition_set') . " <input class=\"checkbox\" type=\"checkbox\" name=\"viewdetail\" value=\"1\" onclick=\"alterview('morefilter')\">" . lang('viewdetail'));
amessage('usuedifin', "?entry=usualurls&action=usualurlsedit{$mc_suffix}"); } } elseif ($action == 'usualurldetail' && $uid) { if (!($usualurl = $db->fetch_one("SELECT * FROM {$tblprefix}usualurls WHERE uid='{$uid}'"))) { amessage('chooseusu'); } if (!submitcheck('busualurldetail')) { tabheader(lang('edit') . $mc_str . lang('usualurl'), 'usualurldetail', "?entry=usualurls&action=usualurldetail&uid={$uid}{$mc_suffix}"); trbasic(lang('usuatitle'), 'usualurlnew[title]', $usualurl['title'], 'text'); trbasic(lang('usualurl'), 'usualurlnew[url]', $usualurl['url'], 'btext'); trbasic(lang('usuorder'), 'usualurlnew[vieworder]', $usualurl['vieworder'], 'text'); trspecial(lang('urlimage'), 'usualurlnew[logo]', $usualurl['logo'], 'image'); trbasic(lang('newwin'), 'usualurlnew[newwin]', $usualurl['newwin'], 'radio'); if (!$ismc) { $sidsarr = array('m' => lang('msite')) + sidsarr(1); trbasic(lang('belsitforuse'), '', makecheckbox('sidsnew[]', $sidsarr, $usualurl['sids'] === '' ? array() : explode(',', $usualurl['sids']), 5), ''); trbasic(lang('inhitatt'), 'usualurlnew[actsid]', $usualurl['actsid'], 'radio'); } else { trbasic(lang('onclick'), 'usualurlnew[onclick]', $usualurl['onclick'], 'btext'); } trbasic(lang('u_permission_set'), 'usualurlnew[pmid]', makeoption(pmidsarr('menu'), $usualurl['pmid']), 'select'); tabfooter('busualurldetail'); a_guide('usualurldetail'); } else { $usualurlnew['title'] = trim(strip_tags($usualurlnew['title'])); $usualurlnew['url'] = trim(strip_tags($usualurlnew['url'])); $usualurlnew['vieworder'] = max(0, intval($usualurlnew['vieworder'])); $usualurlnew['title'] = empty($usualurlnew['title']) ? $usualurl['title'] : $usualurlnew['title']; $usualurlnew['url'] = empty($usualurlnew['url']) ? $usualurl['url'] : $usualurlnew['url']; $c_upload = new cls_upload(); $usualurlnew['logo'] = upload_s($usualurlnew['logo'], $usualurl['logo'], 'image');
$wheresql = $mcnvar ? "WHERE mcnvar='{$mcnvar}'" : ''; $fromsql = "FROM {$tblprefix}mcnodes"; $filterstr = ''; foreach (array('staticmode', 'ptypestr', 'numperpic', 'mcnvar') as $k) { $filterstr .= "&{$k}=" . rawurlencode(${$k}); } if (!submitcheck('bcnodes')) { url_nav(lang('staticadmin'), $urlsarr, 'mcnodes'); $staticarr = array('0' => lang('pascresta'), '1' => lang('actcresta'), '2' => lang('repstaurl')); $ptypearr = array(); for ($i = 0; $i <= $mcn_max_addno; $i++) { $ptypearr[$i] = $i ? lang('addp') . $i : lang('index'); } tabheader(lang('crecatcnodpagsta'), 'archives', "?entry={$entry}&action={$action}{$param_suffix}"); trbasic(lang('stacremo'), '', makeradio('staticmode', $staticarr, $staticmode), ''); trbasic(lang('choatpaty'), '', makecheckbox('ptypes[]', $ptypearr, $ptypes), ''); trbasic(lang('numperpic20_500'), 'numperpic', $numperpic); tabfooter(); $filtercounts = $db->result_one("SELECT count(*) {$fromsql} {$wheresql}"); tabheader(lang('ficatcnocuo') . $filtercounts); $mcnvars = array('' => lang('alltype'), 'caid' => lang('catalog')); foreach ($cotypes as $k => $v) { !$v['self_reg'] && ($mcnvars['ccid' . $k] = $v['cname']); } foreach ($grouptypes as $k => $v) { !$v['issystem'] && ($mcnvars['ugid' . $k] = $v['cname']); } $mcnvars['matid'] = lang('matype'); $mcnvars['mcnid'] = lang('customnode'); trbasic(lang('nodetype'), 'mcnvar', makeoption($mcnvars, $mcnvar), 'select'); tabfooter();
if ($result['email_forwarders'] == '-1') { $result['email_forwarders'] = ''; } $email_quota_ul = makecheckbox('email_quota_ul', $lng['customer']['unlimited'], '-1', false, $result['email_quota'], true, true); if ($result['email_quota'] == '-1') { $result['email_quota'] = ''; } $ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true); if ($result['ftps'] == '-1') { $result['ftps'] = ''; } $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true); if ($result['tickets'] == '-1') { $result['tickets'] = ''; } $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true); if ($result['mysqls'] == '-1') { $result['mysqls'] = ''; } $language_options = ''; while (list($language_file, $language_name) = each($languages)) { $language_options .= makeoption($language_name, $language_file, $result['def_language'], true); } $ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']); $ipsandports_stmt = Database::query("\n\t\t\t\t\tSELECT `id`, `ip` FROM `" . TABLE_PANEL_IPSANDPORTS . "` GROUP BY `ip` ORDER BY `ip`, `port` ASC\n\t\t\t\t"); while ($row = $ipsandports_stmt->fetch(PDO::FETCH_ASSOC)) { $ipaddress .= makeoption($row['ip'], $row['id'], $result['ip']); } $result = htmlentities_array($result); $admin_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/admin/formfield.admin_edit.php'); $admin_edit_form = htmlform::genHTMLForm($admin_edit_data);
trbasic(lang('cartkey'), 'mconfigsnew[cartkey]', !empty($mconfigs['cartkey']) ? $mconfigs['cartkey'] : '', 'text'); trbasic(lang('extract_mincount'), 'mconfigsnew[extract_mincount]', !empty($mconfigs['extract_mincount']) ? $mconfigs['extract_mincount'] : 50, 'text'); tabfooter(); tabheader(lang('mypaymode')); $pmodearr = array('0' => lang('paynext'), '1' => lang('paycurrency'), '2' => lang('payalipay'), '3' => lang('paytenpay')); $omodearr = array('0' => lang('be_confirm'), '1' => lang('no_confirm')); $payarr = array(); for ($i = 0; $i < 32; $i++) { if (@$mconfigs['cfg_paymode'] & 1 << $i) { $payarr[] = $i; } } for ($i = 1; $i < 4; $i++) { ${"sp{$i}"} = isset($mconfigs["shipingfee{$i}"]) ? $mconfigs["shipingfee{$i}"] : -1; } trbasic(lang('paymode'), '', makecheckbox('paymodenew[]', $pmodearr, $payarr), ''); trbasic(lang('ordmode'), '', makeradio('mconfigsnew[cfg_ordermode]', $omodearr, @$cfg_ordermode), ''); trbasic('<input name="spmd[1]" type="checkbox" class="checkbox" value="1"' . ($sp1 < 0 ? '' : ' checked="checked"') . ' />' . lang('shipingfee1'), 'shipingfee[1]', $sp1 < 0 ? 0 : $sp1); trbasic('<input name="spmd[2]" type="checkbox" class="checkbox" value="1"' . ($sp2 < 0 ? '' : ' checked="checked"') . ' />' . lang('shipingfee2'), 'shipingfee[2]', $sp2 < 0 ? 0 : $sp2); trbasic('<input name="spmd[3]" type="checkbox" class="checkbox" value="1"' . ($sp3 < 0 ? '' : ' checked="checked"') . ' />' . lang('shipingfee3'), 'shipingfee[3]', $sp3 < 0 ? 0 : $sp3); tabfooter(); tabheader(lang('onlpayset', lang('alipey'))); trbasic(lang('partnerid'), 'mconfigsnew[cfg_alipay]', @$mconfigs['cfg_alipay']); trbasic(lang('alipay_partner'), 'mconfigsnew[cfg_alipay_partnerid]', @$mconfigs['cfg_alipay_partnerid']); trbasic(lang('paykey'), 'mconfigsnew[cfg_alipay_keyt]', @$mconfigs['cfg_alipay_keyt']); tabfooter(); tabheader(lang('onlpayset', lang('tenpay'))); trbasic(lang('partnerid'), 'mconfigsnew[cfg_tenpay]', @$mconfigs['cfg_tenpay']); trbasic(lang('paykey'), 'mconfigsnew[cfg_tenpay_keyt]', @$mconfigs['cfg_tenpay_keyt']); tabfooter(); echo "<input class=\"button\" type=\"submit\" name=\"bmconfigs\" value=\"" . lang('submit') . "\"></form>";
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); if (empty($submitmode)) { global $cfields, $ucotypes; load_cache('cfields,ucotypes'); tabfooter(); tabheader(lang('pageresult')); $listsarr = array(); foreach ($ucotypes as $k => $v) { if ($v['cclass'] == 'comment') { $listsarr['uccid' . $k] = $v['cname']; } } foreach ($cfields as $k => $v) { $listsarr[$k] = $v['cname']; } trbasic(lang('arange_field') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkalllists\" onclick=\"checkall(this.form,'listsnew','chkalllists')\">" . lang('selectall'), '', makecheckbox('listsnew[]', $listsarr, empty($inmurl['setting']['lists']) ? array() : explode(',', $inmurl['setting']['lists']), 5), '', lang('agnoselect1')); trbasic(lang('adm_title'), 'inmurlnew[mtitle]', $inmurl['mtitle'], 'text', lang('aga_title')); trbasic(lang('adm_guide'), 'inmurlnew[guide]', $inmurl['guide'], 'textarea', lang('aga_title')); $tnstr = "<input type=\"text\" size=\"25\" id=\"inmurlnew[tplname]\" name=\"inmurlnew[tplname]\" value=\"{$inmurl['tplname']}\"> \n\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"inmurlnew[onlyview]\" id=\"inmurlnew[onlyview]\" value=\"1\"" . (empty($inmurl['onlyview']) ? '' : ' checked') . ">" . lang('onlyview'); trbasic(lang('customapage'), '', $tnstr, '', lang('agcustomapage')); } else { foreach (array('lists') as $var) { $inmurlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'}); } $inmurlnew['url'] = "?action=comment&nimuid={$imuid}&cid="; }
/** * 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> '; $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> <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> '; $question .= makeyesno('update_deferr_enable', '1', '0', '0') . '<br /><br />'; if (Settings::Get('system.webserver') == 'apache2') { $question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />'; $question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />'; $question .= 'Path/URL for error 403: <input type="text" class="text" name="update_deferr_403" /><br /><br />'; } $question .= 'Path/URL for error 404: <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> '; $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> '; $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> '; $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> '; $question .= makeyesno('update_customredirect_enable', '1', '0', '1') . '<br /><br />'; $question .= '<strong>Select default redirect code (default: empty):</strong> '; $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 /> '; $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> '; $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> <input type="text" class="text" name="update_httpuser" value="' . $guessed_user . '" />'; } elseif ($has_nogroup) { $question2 = '<strong>Please enter the webservers groupname:</strong> <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> '; $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> '; $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> '; $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> '; $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: '; $question .= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />'; $question .= 'Local group: '; $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> '; $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): '; $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> '; $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> '; $question .= '<input type="text" class="text" name="update_autoresponder_default" value="0" /> ' . 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> '; $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> '; $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> '; $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> '; $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> '; $question .= makeyesno('update_phpfpm_enabled', '1', '0', '0') . '<br /><br />'; $question .= 'If \'yes\', please specify the configuration directory: '; $question .= '<input type="text" class="text" name="update_phpfpm_configdir" value="/etc/php-fpm.d/" /><br /><br />'; $question .= 'Please specify the temporary files directory: '; $question .= '<input type="text" class="text" name="update_phpfpm_tmpdir" value="/var/customers/tmp/" /><br /><br />'; $question .= 'Please specify the PEAR directory: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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> '; $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: '; $question .= '<input type="text" class="text" name="update_phpfpm_httpuser" value="' . Settings::Get('system.mod_fcgid_httpuser') . '" /><br /><br />'; $question .= 'Local group: '; $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> '; $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: '; $question .= '<input type="text" class="text" name="update_system_report_webmax" value="90" /><br /><br />'; $question .= 'Traffic warning level: '; $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> '; $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> '; $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> '; $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> '; $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> '; $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> '; $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> '; $question .= "Admins: " . makeyesno('allow_themechange_a', '1', '0', '1') . ' '; $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> '; $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> '; $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"><IfModule mod_fastcgi.c> FastCgiIpcDir /var/lib/apache2/fastcgi/ <Location "/fastcgiphp"> Order Deny,Allow Deny from All # Prevent accessing this path directly Allow from env=REDIRECT_STATUS </Location> </IfModule></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> '; $question .= makeyesno('update_error_report_admin', '1', '0', '1') . '<br />'; $question .= '<strong>Do you want to enable error-reporting for customers? (default: no):</strong> '; $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> '; $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> '; $question .= makeyesno('mailtraffic_enabled', '1', '0', '1') . '<br />'; $question .= '<strong>Mail Transfer Agent</strong><br />'; $question .= 'Type of your MTA: '; $question .= '<select name="mtaserver">'; $question .= makeoption('Postfix', 'postfix', 'postfix'); $question .= makeoption('Exim4', 'exim4', 'postfix'); $question .= '</select><br />'; $question .= 'Logfile for your MTA: '; $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: '; $question .= '<select name="mdaserver">'; $question .= makeoption('Dovecot', 'dovecot', 'dovecot'); $question .= makeoption('Courier', 'courier', 'dovecot'); $question .= '</select><br /><br />'; $question .= 'Logfile for your MDA: '; $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> '; $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> '; $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> '; $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> '; $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") . "\";"); } }
$mcatalognew['title'] = empty($mcatalognew['title']) ? $mcatalogs[$mcaid]['title'] : trim(strip_tags($mcatalognew['title'])); $mcatalognew['remark'] = trim(strip_tags($mcatalognew['remark'])); $mcatalognew['maxucid'] = max(0, intval($mcatalognew['maxucid'])); $mcatalognew['vieworder'] = max(0, intval($mcatalognew['vieworder'])); $db->query("UPDATE {$tblprefix}mcatalogs SET \n\t\t\t\t\t\t\ttitle='{$mcatalognew['title']}',\n\t\t\t\t\t\t\tremark='{$mcatalognew['remark']}',\n\t\t\t\t\t\t\tmaxucid='{$mcatalognew['maxucid']}',\n\t\t\t\t\t\t\tvieworder='{$mcatalognew['vieworder']}'\n\t\t\t\t\t\t\tWHERE mcaid='{$mcaid}'"); } } updatecache('mcatalogs'); adminlog(lang('edispacatmanlis')); amessage('spacatmodfin', "?entry=mtconfigs&action=mtconfigsedit"); } } elseif ($action == 'mtconfigadd') { if (!submitcheck('bmtconfigadd')) { tabheader(lang('spatemproadd'), 'mtconfigadd', '?entry=mtconfigs&action=mtconfigadd'); trbasic(lang('temprocna'), 'mtconfigadd[cname]'); trbasic(lang('inchallowuse'), '', makecheckbox('mtconfigadd[mchids][]', mchidsarr(), array(), 5), ''); tabfooter('bmtconfigadd'); a_guide('mtconfigadd'); } else { if (empty($mtconfigadd['cname'])) { amessage('temprodatmis', M_REFERER); } $mtconfigadd['mchids'] = !empty($mtconfigadd['mchids']) ? implode(',', $mtconfigadd['mchids']) : ''; $db->query("INSERT INTO {$tblprefix}mtconfigs SET cname='{$mtconfigadd['cname']}',mchids='{$mtconfigadd['mchids']}'"); updatecache('mtconfigs'); adminlog(lang('addspatempro')); amessage('temproaddfin', '?entry=mtconfigs&action=mtconfigsedit'); } } elseif ($action == 'mcatalogadd') { if (!submitcheck('bmcatalogadd')) { tabheader(lang('addspaccata'), 'mcatalogadd', '?entry=mtconfigs&action=mcatalogadd');
/** * 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 $settings, $lng, $db; 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> '; $question .= makeyesno('update_domainwildcardentry', '1', '0', '1'); eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } if (versionInUpdate($current_version, '0.9.6-svn2')) { if (!PHPMailer::ValidateAddress($settings['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> <input type="text" class="text" name="update_adminmail" value="' . $settings['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> '; $question .= makeyesno('update_deferr_enable', '1', '0', '0') . '<br /><br />'; if ($settings['system']['webserver'] == 'apache2') { $question .= 'Path/URL for error 500: <input type="text" class="text" name="update_deferr_500" /><br /><br />'; $question .= 'Path/URL for error 401: <input type="text" class="text" name="update_deferr_401" /><br /><br />'; $question .= 'Path/URL for error 403: <input type="text" class="text" name="update_deferr_403" /><br /><br />'; } $question .= 'Path/URL for error 404: <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> '; $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> '; $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> '; $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> '; $question .= makeyesno('update_customredirect_enable', '1', '0', '1') . '<br /><br />'; $question .= '<strong>Select default redirect code (default: empty):</strong> '; $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 = $db->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 = $db->fetch_array($result)) { $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 /> '; $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> '; $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 = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpuser'"); 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 = $db->query_first("SELECT * FROM `" . TABLE_PANEL_SETTINGS . "` WHERE `settinggroup` = 'system' AND `varname` = 'httpgroup'"); 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> <input type="text" class="text" name="update_httpuser" value="' . $guessed_user . '" />'; } elseif ($has_nogroup) { $question2 = '<strong>Please enter the webservers groupname:</strong> <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> '; $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> '; $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> '; $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['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> '; $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: '; $question .= '<input type="text" class="text" name="update_fcgid_httpuser" value="froxlorlocal" /><br /><br />'; $question .= 'Local group: '; $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> '; $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): '; $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['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> '; $question .= '<input type="text" class="text" name="update_awstats_awstatspath" value="' . $settings['system']['awstats_path'] . '" /><br />'; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } } if (versionInUpdate($current_version, '0.9.13-svn1')) { if ((int) $settings['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> '; $question .= '<input type="text" class="text" name="update_autoresponder_default" value="0" /> ' . 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['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> '; $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['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> '; $question .= '<input type="text" class="text" name="update_awstats_icons" value="' . $settings['system']['awstats_icons'] . '" />'; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } } if (versionInUpdate($current_version, '0.9.14-svn4')) { if ((int) $settings['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> '; $question .= '<input type="text" class="text" name="update_ssl_cert_chainfile" value="' . $settings['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> '; $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> '; $question .= makeyesno('update_phpfpm_enabled', '1', '0', '0') . '<br /><br />'; $question .= 'If \'yes\', please specify the configuration directory: '; $question .= '<input type="text" class="text" name="update_phpfpm_configdir" value="/etc/php-fpm.d/" /><br /><br />'; $question .= 'Please specify the temporary files directory: '; $question .= '<input type="text" class="text" name="update_phpfpm_tmpdir" value="/var/customers/tmp/" /><br /><br />'; $question .= 'Please specify the PEAR directory: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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: '; $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['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> '; $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: '; $question .= '<input type="text" class="text" name="update_phpfpm_httpuser" value="' . $settings['system']['mod_fcgid_httpuser'] . '" /><br /><br />'; $question .= 'Local group: '; $question .= '<input type="text" class="text" name="update_phpfpm_httpgroup" value="' . $settings['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> '; $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: '; $question .= '<input type="text" class="text" name="update_system_report_webmax" value="90" /><br /><br />'; $question .= 'Traffic warning level: '; $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> '; $question .= '<select name="update_default_theme">'; $themes = getThemes(); foreach ($themes as $theme) { $question .= makeoption($theme, $theme, 'Froxlor'); } $question .= '</select>'; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } }
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); if (empty($mcommu['uconfig'])) { if ($action == 'mcommudetail') { if (empty($submitmode)) { load_cache('mbfields'); $fieldsarr = array(); foreach ($mbfields as $k => $v) { $fieldsarr[$k] = $v['cname']; } trbasic(lang('operate_permi_set'), 'mcommunew[setting][apmid]', makeoption(pmidsarr('cuadd'), empty($mcommu['setting']['apmid']) ? 0 : $mcommu['setting']['apmid']), 'select'); trbasic(lang('forbid_reoperate'), 'mcommunew[setting][norepeat]', isset($mcommu['setting']['norepeat']) ? $mcommu['setting']['norepeat'] : 0, 'radio'); trbasic(lang('reoperate_time_m'), 'mcommunew[setting][repeattime]', isset($mcommu['setting']['repeattime']) ? $mcommu['setting']['repeattime'] : 0); trbasic(lang('ava_msg_field'), 'fieldsnew[]', makecheckbox('fieldsnew[]', $fieldsarr, empty($mcommu['setting']['fields']) ? array() : explode(',', $mcommu['setting']['fields']), 5), ''); tabfooter(); tabfooter(); tabheader(lang('advsetting') . " <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'), 'mcommunew[ucadd]', empty($mcommu['ucadd']) ? '' : $mcommu['ucadd'], 'text', lang('agmucustom')); trbasic(lang('custom_uadetail'), 'mcommunew[uadetail]', empty($mcommu['uadetail']) ? '' : $mcommu['uadetail'], 'text', lang('agmucustom')); trbasic(lang('custom_umdetail'), 'mcommunew[umdetail]', empty($mcommu['umdetail']) ? '' : $mcommu['umdetail'], 'text', lang('agmucustom')); trbasic(lang('customsetting'), 'mcommunew[usetting]', empty($mcommu['usetting']) ? '' : $mcommu['usetting'], 'btextarea', lang('agcustomsetting')); echo "</tbody>"; } else { $mcommunew['setting']['repeattime'] = max(0, intval($mcommunew['setting']['repeattime'])); $mcommunew['setting']['fields'] = empty($fieldsnew) ? '' : implode(',', $fieldsnew); } } } else { include M_ROOT . $mcommu['uconfig'];
} } elseif ($action == 'setusual' && $tname) { //设为常用分类 empty($mtags[$tname]) && amessage('choosetag'); $mtag = read_cache($ttype, $tname, '', $sid); $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . urlencode($forward); if (!submitcheck('bsetusual')) { tabheader(lang('setusualtag'), 'setusual', "?entry=mtags&action=setusual&ttype={$ttype}{$param_suffix}&tname={$tname}{$forwardstr}"); trbasic(lang('tagname'), '', $mtag['cname'], ''); trbasic(lang('usualtagremark'), 'mtagnew[title]', empty($usualtags[$ttype . '_' . $tname]['title']) ? '' : $usualtags[$ttype . '_' . $tname]['title'], 'btext'); $tagclassesarr = array(); foreach ($tagclasses as $k => $v) { $tagclassesarr[$k] = $v['cname']; } trbasic(lang('usualtagclass'), '', makecheckbox('mtagnew[class][]', $tagclassesarr, empty($usualtags[$ttype . '_' . $tname]['class']) ? array() : explode(',', $usualtags[$ttype . '_' . $tname]['class'])), ''); tabfooter('bsetusual'); } else { $mtagnew['class'] = empty($mtagnew['class']) ? '' : implode(',', $mtagnew['class']); $usualtags[$ttype . '_' . $tname] = array('title' => stripslashes(trim($mtagnew['title'])), 'class' => $mtagnew['class'], 'ttype' => $ttype, 'tname' => $tname, 'vieworder' => 0); mtags_order($usualtags); cache2file($usualtags, 'usualtags', 'usualtags', $sid); amessage('setusualfin', axaction(6, $forward)); } } elseif ($action == 'mtagscopy' && $tname) { $forward = empty($forward) ? M_REFERER : $forward; $forwardstr = '&forward=' . urlencode($forward); empty($mtags[$tname]) && amessage('choosetag', $forward); $mtag = read_cache($ttype, $tname, '', $sid); if (!submitcheck('bmtagscopy')) { tabheader(lang('copy ' . $ttype), 'mtagscopy', "?entry=mtags&action=mtagscopy&ttype={$ttype}{$param_suffix}&tname={$tname}{$forwardstr}");
<?php (!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission'); if (empty($submitmode)) { tabfooter(); tabheader(lang('arangeset')); $checkedarr = array('-1' => lang('nolimit'), '0' => lang('nocheck'), '1' => lang('checked')); trbasic(lang('arange') . lang('check_state'), '', makeradio('aurlnew[setting][checked]', $checkedarr, !isset($aurl['setting']['checked']) ? '-1' : $aurl['setting']['checked']), ''); $validarr = array('-1' => lang('nolimit'), '0' => lang('invalid'), '1' => lang('available')); trbasic(lang('arange') . lang('validperiod_state'), '', makeradio('aurlnew[setting][valid]', $validarr, !isset($aurl['setting']['valid']) ? '-1' : $aurl['setting']['valid']), ''); trbasic(lang('arange') . lang('isconsult'), 'aurlnew[setting][consult]', empty($aurl['setting']['consult']) ? 0 : 1, 'radio'); tabfooter(); tabheader(lang('pageresult')); $tnstr = "<input type=\"text\" size=\"25\" id=\"aurlnew[tplname]\" name=\"aurlnew[tplname]\" value=\"{$aurl['tplname']}\"> \n\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"aurlnew[onlyview]\" id=\"aurlnew[onlyview]\" value=\"1\"" . (empty($aurl['onlyview']) ? '' : ' checked') . ">" . lang('onlyview'); trbasic(lang('customapage'), '', $tnstr, '', lang('agcustomapage')); trbasic(lang('adm_title'), 'aurlnew[mtitle]', $aurl['mtitle'], 'text', lang('aga_title')); trbasic(lang('adm_guide'), 'aurlnew[guide]', $aurl['guide'], 'textarea', lang('aga_title')); $filtersarr = array('check' => lang('check_state'), 'valid' => lang('validperiod_state'), 'qstate' => lang('qstate')); trbasic(lang('view_filters') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallfilters\" onclick=\"checkall(this.form,'filtersnew','chkallfilters')\">" . lang('selectall'), '', makecheckbox('filtersnew[]', $filtersarr, empty($aurl['setting']['filters']) ? array() : explode(',', $aurl['setting']['filters']), 5), '', lang('agnoselect1')); $listsarr = array('catalog' => lang('coclass'), 'mname' => lang('member'), 'check' => lang('check_state'), 'valid' => lang('validperiod_state'), 'qstate' => lang('qstate'), 'adddate' => lang('add_time'), 'updatedate' => lang('update_time'), 'startdate' => lang('startdate'), 'enddate' => lang('end1_time'), 'vieworder' => lang('order'), 'qadmin' => lang('qadmin'), 'edit' => lang('edit')); trbasic(lang('view_lists') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkalllists\" onclick=\"checkall(this.form,'listsnew','chkalllists')\">" . lang('selectall'), '', makecheckbox('listsnew[]', $listsarr, empty($aurl['setting']['lists']) ? array() : explode(',', $aurl['setting']['lists']), 5), '', lang('agnoselect1')); $operatesarr = array('delete' => lang('delete'), 'check' => lang('check'), 'uncheck' => lang('uncheck'), 'static' => lang('static'), 'unstatic' => lang('unstatic')); trbasic(lang('view_operates') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkalloperates\" onclick=\"checkall(this.form,'operatesnew','chkalloperates')\">" . lang('selectall'), '', makecheckbox('operatesnew[]', $operatesarr, empty($aurl['setting']['operates']) ? array() : explode(',', $aurl['setting']['operates']), 5), '', lang('agnoselect1')); } else { foreach (array('filters', 'lists', 'operates') as $var) { $aurlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'}); } $aurlnew['url'] = "?entry=farchives&action=farchivesedit&nauid={$auid}"; }
tabfooter('bmemcertadd'); } else { $db->num_rows($db->query("SELECT mcid FROM {$tblprefix}memcerts WHERE title='{$memcertadd['title']}'")) ? amessage('memcert_exists', "?entry={$entry}&action={$action}") : ($db->query("INSERT INTO {$tblprefix}memcerts SET title='{$memcertadd['title']}'") && ($mcid = $db->insert_id()) ? amessage('memcert_add_modify', "?entry={$entry}&action=detail&mcid={$mcid}") : amessage('memcert_add_error', "?entry={$entry}&action={$action}")); } break; case 'detail': //修改类别 (empty($mcid) || !($memcert = $db->fetch_one("SELECT * FROM {$tblprefix}memcerts WHERE mcid='{$mcid}'"))) && amessage('memcert_modify_fail'); if (!submitcheck('bmemcertmodify')) { include_once M_ROOT . "./include/fields.cls.php"; tabheader(lang('memcert_modify'), 'memcert_modify', "?entry={$entry}&action={$action}&mcid={$mcid}"); trbasic(lang('memcert_title'), '', $memcert['title'], ''); trspecial(lang('memcert_icon'), 'memcertnew[icon]', $memcert['icon'], 'image'); trbasic(lang('memcert_remark'), 'memcertnew[remark]', $memcert['remark'], 'textarea'); trbasic(lang('memcert_level'), 'memcertnew[level]', $memcert['level'], 'text', lang('memcert_level_tip')); trbasic(lang('memcert_mchid') . "<br/><input class=\"checkbox\" type=\"checkbox\" id=\"chkall_mchid\" onclick=\"checkall(this.form,'memcertnew[mchids]','chkall_mchid')\"><label for=\"chkall_mchid\">" . lang('selectall') . "</label>", '', makecheckbox('memcertnew[mchids][]', $mchannels, explode(',', $memcert['mchids'])), ''); trbasic(lang('memcert_mobile_field'), 'memcertnew[mobile]', $memcert['mobile'], 'text', lang('memcert_special_tip')); trbasic(lang('memcert_email_field'), 'memcertnew[email]', $memcert['email'], 'text', lang('memcert_special_tip')); trbasic(lang('memcert_fields'), 'memcertnew[fields]', $memcert['fields'], 'textarea', lang('memcert_fields_tip')); // trbasic(lang('memcert_and_checked'), '', makeradio('memcertnew[check]', array(1 => lang('yes'), 0 => lang('no')), $memcert['check']), ''); tabfooter('bmemcertmodify'); } else { !empty($memcertnew['mobile']) && preg_match("/\\W/", $memcertnew['mobile']) && amessage('memcert_mode_fail', "?entry={$entry}&action={$action}&mcid={$mcid}"); !empty($memcertnew['email']) && preg_match("/\\W/", $memcertnew['email']) && amessage('memcert_mode_fail', "?entry={$entry}&action={$action}&mcid={$mcid}"); (empty($memcertnew['mobile']) && empty($memcertnew['email']) && empty($memcertnew['fields']) || !empty($memcertnew['fields']) && !preg_match("/^\\w+(?:,\\w+)*\$/", $memcertnew['fields'])) && amessage('memcert_fields_fail', "?entry={$entry}&action={$action}&mcid={$mcid}"); include_once M_ROOT . "./include/upload.cls.php"; $memcertnew['mchids'] = join(',', array_filter($memcertnew['mchids'])); $db->query("UPDATE {$tblprefix}memcerts SET " . "icon='{$memcertnew['icon']}'," . "remark='{$memcertnew['remark']}'," . "mchids='{$memcertnew['mchids']}'," . "mobile='{$memcertnew['mobile']}'," . "email='{$memcertnew['email']}'," . "fields='{$memcertnew['fields']}'" . " WHERE mcid={$mcid}"); if ($memcertnew['level'] != $memcert['level']) { $levels = array($mcid => $memcertnew['level']); $query = $db->query("SELECT mcid,level FROM {$tblprefix}memcerts WHERE mcid!='{$mcid}' ORDER BY level DESC");
$tnstr = "<input type=\"text\" size=\"25\" id=\"murlnew[tplname]\" name=\"murlnew[tplname]\" value=\"{$murl['tplname']}\"> \n\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"murlnew[onlyview]\" id=\"murlnew[onlyview]\" value=\"1\"" . (empty($murl['onlyview']) ? '' : ' checked') . ">" . lang('onlyview'); trbasic(lang('customapage'), '', $tnstr, '', lang('agcustomapage')); $filtersarr = array('commu' => lang('commuitem'), 'channel' => lang('achannel'), 'check' => lang('check_state')); foreach ($ucotypes as $k => $v) { if ($v['cclass'] == 'comment') { $filtersarr['uccid' . $k] = $v['cname']; } } trbasic(lang('view_filters') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallfilters\" onclick=\"checkall(this.form,'filtersnew','chkallfilters')\">" . lang('selectall'), '', makecheckbox('filtersnew[]', $filtersarr, empty($murl['setting']['filters']) ? array() : explode(',', $murl['setting']['filters']), 5), '', lang('agnoselect1')); $listsarr = array('catalog' => lang('catalog'), 'uclass' => lang('uclass'), 'channel' => lang('achannel'), 'commu' => lang('commuitem'), 'check' => lang('check_state'), 'adddate' => lang('add_time'), 'updatedate' => lang('update_time'), 'edit' => lang('edit')); foreach ($ucotypes as $k => $v) { if ($v['cclass'] == 'comment') { $listsarr['uccid' . $k] = $v['cname']; } } trbasic(lang('view_lists') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkalllists\" onclick=\"checkall(this.form,'listsnew','chkalllists')\">" . lang('selectall'), '', makecheckbox('listsnew[]', $listsarr, empty($murl['setting']['lists']) ? array() : explode(',', $murl['setting']['lists']), 5), '', lang('agnoselect1')); $imuidsarr = array(); foreach ($inmurls as $k => $v) { if (in_array($v['uclass'], array('commentetail', 'custom'))) { $imuidsarr[$k] = '<b>' . $v['cname'] . '</b> ' . $v['remark']; } } trbasic(lang('view_inmurls') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallimuids\" onclick=\"checkall(this.form,'imuidsnew','chkallimuids')\">" . lang('selectall'), '', makecheckbox('imuidsnew[]', $imuidsarr, empty($murl['setting']['imuids']) ? array() : explode(',', $murl['setting']['imuids']), 3), '', lang('agnoselect1')); trbasic(lang('adm_title'), 'murlnew[mtitle]', $murl['mtitle'], 'text', lang('aga_title')); trbasic(lang('adm_guide'), 'murlnew[guide]', $murl['guide'], 'textarea', lang('aga_title')); } else { foreach (array('cuids', 'caids', 'chids', 'filters', 'lists', 'imuids') as $var) { $murlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'}); } $murlnew['url'] = "?action=comments&nmuid={$muid}"; }
$sqlstr .= ",{$k}='" . addslashes($v) . "'"; } } $db->query("INSERT INTO {$tblprefix}usergroups SET {$sqlstr}"); $ugid = $db->insert_id(); adminlog(lang('copyusergroup')); updatecache('usergroups', $gtid); amessage('usercopyfin', "?entry=usergroups&action=usergroupdetail>id={$gtid}&ugid={$ugid}"); } } elseif ($action == 'usergroupdetail' && $gtid && $ugid) { $forward = empty($forward) ? M_REFERER : $forward; $usergroup = read_cache('usergroup', $gtid, $ugid); if (!submitcheck('busergroupdetail')) { tabheader(lang('editusergroup') . '-' . $grouptype['cname'], 'usergroupdetail', "?entry=usergroups&action=usergroupdetail>id={$gtid}&ugid={$ugid}&forward=" . rawurlencode($forward), 2, 0, 0, 1); trbasic(lang('usergroupcname'), 'usergroupnew[cname]', $usergroup['cname']); trbasic(lang('inchallowuse'), '', makecheckbox('usergroupnew[mchids][]', mchidsarr(), !empty($usergroup['mchids']) ? explode(',', $usergroup['mchids']) : array(), 5), ''); trbasic(lang('uservalid') . '(' . lang('day') . ')', 'usergroupnew[limitday]', $usergroup['limitday']); if (!$grouptype['issystem'] && $grouptype['mode'] != 2) { trbasic(lang('autoinit'), 'usergroupnew[autoinit]', $usergroup['autoinit'], 'radio', lang('agautoinit')); } if ($grouptype['forbidden']) { trbasic(lang('alloissuearch'), 'usergroupnew[issuepermit]', $usergroup['issuepermit'], 'radio'); trbasic(lang('allissuecomm'), 'usergroupnew[commentpermit]', $usergroup['commentpermit'], 'radio'); trbasic(lang('allpurcgoods'), 'usergroupnew[purchasepermit]', $usergroup['purchasepermit'], 'radio'); trbasic(lang('alloissans'), 'usergroupnew[answerpermit]', $usergroup['answerpermit'], 'radio'); trbasic(lang('allouploattach'), 'usergroupnew[uploadpermit]', $usergroup['uploadpermit'], 'radio'); trbasic(lang('allodownattach'), 'usergroupnew[downloadpermit]', $usergroup['downloadpermit'], 'radio'); } elseif ($grouptype['afunction']) { $amconfigs = reload_cache('amconfigs'); $sidsarr = array('m' => lang('msite')); foreach ($subsites as $k => $v) {