function siteconfig() { if (!$this->haveAccessTo('settings')) { return $this->showAccessDenied(); } if (bff::$isAjax) { switch (func::GET('act')) { case 'im-attach-total-update': $nSize = CAttachment::dirSize(PATH_BASE . 'files/im'); $this->ajaxResponse(array('view' => func::getfilesize($nSize, true), 'size' => $nSize)); break; } $this->ajaxResponse(Errors::IMPOSSIBLE); } $sCurrentTab = func::POSTGET('tab'); if (empty($sCurrentTab)) { $sCurrentTab = 'general'; } if (func::isPostMethod() && func::POST('saveconfig') == 1) { $conf = func::POST('config', false); //set off checkboxes $this->setCheckboxes($conf, array('mail_smtp1_on', 'mail_smtp2_on')); $this->saveConfig($conf, false); //в БД $this->saveConfig($conf, true); //в файл $this->adminRedirect(Errors::SUCCESS, 'siteconfig&tab=' . $sCurrentTab); } $aConfig = config::getAll(); $aConfig = array_map('stripslashes', $aConfig); $aConfig['options'] = array(); $aConfig['options']['im_attach_maxsize'] = $this->getOptionsSizetype(config::get('im_attach_maxsize', 0)); $aConfig['options']['items_images_limit'] = range(1, 10, 1); $aData = $aConfig; $aData['tabs'] = array('general' => array('t' => 'Общие настройки', 'a' => 0), 'mail' => array('t' => 'Почта', 'a' => 0)); $aData['tabs'][$sCurrentTab]['a'] = 1; $this->tplAssign('tab', $sCurrentTab); $this->tplAssignByRef('aData', $aData); $this->adminCustomCenterArea(); return $this->tplFetch('admin.siteconfig.tpl'); }
function sys() { if (!FORDEV) { return $this->showAccessDenied(); } $aData = array(); $aData['maxmemory'] = @ini_get('memory_limit') != '' ? @ini_get('memory_limit') : 'Неопределено'; $aData['disabledfunctions'] = strlen(ini_get('disable_functions')) > 1 ? @ini_get('disable_functions') : 'Неопределено'; $aData['disabledfunctions'] = str_replace(",", ", ", $aData['disabledfunctions']); $aData['safemode'] = @ini_get('safe_mode') == 1 ? 'Включен' : 'Выключен'; //mod_rewrite if (function_exists('apache_get_modules')) { if (array_search('mod_rewrite', apache_get_modules())) { $aData['mod_rewrite'] = 'Включен'; } else { $aData['mod_rewrite'] = '<font color="red">Выключен</font>'; } } else { $aData['mod_rewrite'] = 'Неопределено'; } //mcrypt $aData['extension_mcrypt'] = extension_loaded("mcrypt") ? 'Включен' : '<font color="red">Выключен</font>'; //imap $aData['extension_imap'] = extension_loaded("imap") ? 'Включен' : '<font color="red">Выключен</font>'; //pdo $aData['extension_pdo'] = extension_loaded("pdo") ? 'Включен (' . implode(', ', PDO::getAvailableDrivers()) . ')' : '<font color="red">Выключен</font>'; //spl $aData['extension_spl'] = extension_loaded("spl") ? 'Включен (autoload, iterators...)' : '<font color="red">Выключен</font>'; $aData['os_version'] = php_uname("s") . " " . php_uname("r"); $aData['php_version'] = phpversion(); //mysql version if (extension_loaded('mysql')) { if (function_exists('mysql_get_client_info')) { $current_version = mysql_get_client_info(); // Process version preg_match('/[0-9.]+/', $current_version, $version_matches); $aData['mysql'] = $version_matches[0]; } else { $aData['mysql'] = 'Включено'; } } else { $aData['mysql'] = '<font color="red">Выключено</font>'; } //gd version static $gd_version_number = null; if ($gd_version_number === null) { ob_start(); phpinfo(INFO_MODULES); $module_info = ob_get_contents(); ob_end_clean(); if (preg_match("/\\bgd\\s+version\\b[^\\d\n\r]+?([\\d\\.]+)/i", $module_info, $matches)) { $gdversion_h = $matches[1]; } else { $gdversion_h = 0; } } $aData['gd_version'] = $gdversion_h; $aData['mbstring'] = extension_loaded('mbstring') ? 'Включено' : '<font color="red">Выключено</font>'; $aData['maxexecution'] = @ini_get('max_execution_time'); //upload_max_filesize $aData['maxupload'] = str_replace(array('M', 'm'), '', @ini_get('upload_max_filesize')); $aData['maxupload'] = func::getfilesize($aData['maxupload'] * 1024 * 1024); //post_max_size $aData['maxpost'] = str_replace(array('M', 'm'), '', @ini_get('post_max_size')); $aData['maxpost'] = func::getfilesize($aData['maxpost'] * 1024 * 1024); //Can we find Imagemagick anywhere on the system? $exe = (strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/') == '\\' ? '.exe' : ''; $magic_home = getenv('MAGICK_HOME'); $aData['img_imagick'] = ''; if (empty($magic_home)) { $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/'); $path_locations = str_replace('\\', '/', explode($exe ? ';' : ':', getenv('PATH'))); $locations = array_merge($path_locations, $locations); foreach ($locations as $location) { // The path might not end properly, fudge it if (substr($location, -1, 1) !== '/') { $location .= '/'; } if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) { $aData['img_imagick'] = str_replace('\\', '/', $location); continue; } } } else { $aData['img_imagick'] = str_replace('\\', '/', $magic_home); } $this->tplAssign('aData', $aData); return $this->tplFetch('admin.system.tpl'); }