コード例 #1
0
ファイル: admin_config_save.php プロジェクト: phannack/GCMS
 if ($file_typies == '') {
     $ret['error'] = 'DOWNLOAD_FILE_TYPIES_EMPTY';
     $ret['input'] = 'config_file_typies';
     $ret['ret_config_file_typies'] = 'DOWNLOAD_FILE_TYPIES_EMPTY';
 } elseif ($error) {
     $ret['error'] = 'DOWNLOAD_FILE_TYPIES_INVALID';
     $ret['input'] = 'config_file_typies';
     $ret['ret_config_file_typies'] = 'DOWNLOAD_FILE_TYPIES_INVALID';
 } else {
     // โหลด config ใหม่
     $config = array();
     if (is_file(CONFIG)) {
         include CONFIG;
     }
     // ตรวจสอบความถูกต้องของ mimetype
     $typies = gcms::getMimeTypies(explode(',', $file_typies));
     if (sizeof($typies) == 0) {
         $ret['error'] = 'GET_FILE_MIMETYPE_ERROR';
         $ret['input'] = 'config_file_typies';
         $ret['ret_config_file_typies'] = 'GET_FILE_MIMETYPE_ERROR';
     } elseif (is_array($config['mimeTypes'])) {
         $config['mimeTypes'] = array_merge($config['mimeTypes'], $typies);
     } else {
         $config['mimeTypes'] = $typies;
     }
     if (!isset($ret['error'])) {
         if (isset($_POST['config_can_download'])) {
             $config['download_can_download'] = gcms::getVars($_POST, 'config_can_download', '');
         } else {
             unset($config['download_can_download']);
         }