0x001){$GLOBALS['path_id']=trim($[0x001]);}else{$GLOBALS['path_id']='';}break;}}switch($GLOBALS['path_type']){case '':$=iconv_system(HOME).$;ʏƃʊǪ㵚ŋɴ潢»;break;ɍ;case KOD_USER_RECYCLE:$GLOBALS['path_pre']=trim(USER_RECYCLE,'/');;$GLOBALS['path_id']='';ۢѸ;return iconv_system(USER_RECYCLE).'/'.str_replace(KOD_USER_RECYCLE,'',$);ŌŇ䛔ٖڎμߜ;case KOD_USER_FAV:$GLOBALS['path_pre']=trim(KOD_USER_FAV,'/');$GLOBALS['path_id']='';Л唕ܣ녂פ咔Ӯٰ囧ǵ›;return KOD_USER_FAV;˯챒;case KOD_GROUP_ROOT_SELF:$GLOBALS['path_pre']=trim(KOD_GROUP_ROOT_SELF,'/');Ѵ֮ը՛͖Çड़멘ƜČϷ񦮶ϐ;𺔮ݬ;$GLOBALS['path_id']='';Ӣ;return KOD_GROUP_ROOT_SELF;à;case KOD_GROUP_ROOT_ALL:$GLOBALS['path_pre']=trim(KOD_GROUP_ROOT_ALL,'/');ڗضإÄـ䝥;$GLOBALS['path_id']='';return KOD_GROUP_ROOT_ALL;case KOD_GROUP_PATH:$=system_group::get_info($GLOBALS['path_id']);֔㮷;ؙϽ;if(!$GLOBALS['path_id']|| !$)return !0x001;owner_group_check($GLOBALS['path_id']);݋׸֮ظѯ豭錧;$GLOBALS['path_pre']=group_home_path($);؃;ԏ쌁Ŧβ;׼̬;$=iconv_system($GLOBALS['path_pre']).$;break;;case KOD_GROUP_SHARE:$=system_group::get_info($GLOBALS['path_id']);if(!$GLOBALS['path_id']|| !$)return !0x001;owner_group_check($GLOBALS['path_id']);Ô;۱˓ؔ⍒;ʤЀʂ▟;$GLOBALS['path_pre']=group_home_path($).'share/';ʵƧاˋ;$=iconv_system($GLOBALS['path_pre']).$;break;ӄ츖꛸ἲ;ۙҺ뉂ȭǃݎƇߨњ;茁גύ;case KOD_USER_SHARE:$=system_member::get_info($GLOBALS['path_id']);if(!$GLOBALS['path_id']|| !$)return !0x001;if($GLOBALS['path_id']!=$_SESSION['kod_user']['user_id']){owner_check();}$GLOBALS['path_pre']='';$GLOBALS['path_id_user_share']=$Ɩ;if($==''){return $;}else{$=explode('/',$);$[0]=iconv_app($[0]);$=system_member::user_share_get($GLOBALS['path_id'],$[0]);$GLOBALS['path_id_user_share']=KOD_USER_SHARE.':'.$GLOBALS['path_id'].'/'.$[0].'/';unset($[0]);if(!$)return !0x001;$=rtrim($['path'],'/').'/'.iconv_app(implode('/',$));;if($['role']!='1'){$롼=user_home_path($);$GLOBALS['path_pre']=$롼.rtrim($['path'],'/').'/';$=$롼.$;}else{$GLOBALS['path_pre']=$['path'];$=$;}if($['type']=='file'){$GLOBALS['path_id_user_share']=rtrim($GLOBALS['path_id_user_share'],'/');$GLOBALS['path_pre']=rtrim($GLOBALS['path_pre'],'/');}$=iconv_system($);}break;ĈХɧކ;default:break;}if($!='/'){$=rtrim($,'/');if(is_dir($))$=$.'/';}return $;}function _DIR_OUT($){if(is_array($)){foreach($['filelist'] as $ܨ=>&$ҷ){$ҷ['path']=pre_clear($ҷ['path']);}foreach($['folderlist'] as $ܨ=>&$ҷ){$ҷ['path']=pre_clear(rtrim($ҷ['path'],'/').'/');}}else{$=pre_clear($);}return $;}function pre_clear($){$=$GLOBALS['path_type'];暨ԝ؋˯—;$ϡ=rtrim($GLOBALS['path_pre'],'/');;曅LjȘ˵嚗‚ȌϨ;$=array(KOD_USER_FAV,KOD_GROUP_ROOT_SELF,KOD_GROUP_ROOT_ALL);;Ы;if(isset($GLOBALS['path_type'])&& in_array($GLOBALS['path_type'],$)){return $;}if(ST=='share'){return str_replace($ϡ,'',$);}if($GLOBALS['path_id']!=''){$.=':'.$GLOBALS['path_id'].'/';}if(isset($GLOBALS['path_id_user_share'])){$=$GLOBALS['path_id_user_share'];}$=$.str_replace($ϡ,'',$);$=str_replace('//','/',$);肛;ۊؗкʩ́;return $;}function owner_group_check($ɫ){if(!$ɫ)show_json($GLOBALS['L']['group_not_exist'].$ɫ,!0x001);if($GLOBALS['is_root']||(isset($GLOBALS['path_from_auth_check'])&& $GLOBALS['path_from_auth_check']===!0)){return;}$=system_member::user_auth_group($ɫ);if($!='write'){owner_check();if($==!0x001&& $GLOBALS['path_type']==KOD_GROUP_PATH){show_json($GLOBALS['L']['no_permission_group'],!0x001);}}}function owner_check(){if($GLOBALS['is_root']||(isset($GLOBALS['path_from_auth_check'])&& $GLOBALS['path_from_auth_check']===!0)){return;}$=$GLOBALS['config']['role_guest_check'];if(!array_key_exists(ST,$))return;if(in_array(ACT,$[ST])){show_json($GLOBALS['L']['no_permission_action'],!0x001);}}function zip_pre_name($ؚ){if(get_path_this($ؚ)=='.DS_Store')return '';if(!function_exists('iconv')){return $ؚ;}$귦=$GLOBALS['config']['system_charset'];$='utf-8';╞ڵ͍€䫼󰘿璱߶պ;莜ܷ;$=get_default_lang();;if(client_is_windows()&&($=='zh-CN' || $=='zh-TW' || LANGUAGE_TYPE=='zh-TW' || LANGUAGE_TYPE=='zh-TW')){$="gbk";}$=@iconv($귦,$,$ؚ);if(!$){$=$ؚ;}return $;}function unzip_pre_name($ij){if(!function_exists('iconv')){return $ij;}if(isset($GLOBALS['unzip_file_charset_get'])){$=$GLOBALS['unzip_file_charset_get'];}else{$=get_charset($ij);}$=$GLOBALS['config']['system_charset'];$֖=@iconv($,$,$ij);;ܷЄڟĞʎ;if(!$֖){$֖=$ij;}return $֖;}function unzip_charset_get($){if(count($)==0)return 'utf-8';$=array();„֌₱Λ蕭𭄙;Я±;먥ъ;for($=0;$')|| $ԯ==''){return 0;}if($GLOBALS['is_root']==0x001)return 0x001;$=$GLOBALS['auth']['ext_not_allow'];ɂ빡ς;;$=explode('|',$);foreach($ as $){if($!=='' && stristr($ԯ,'.'.$)){return 0;}}return 0x001;ޯɲכ쌱;}function file_upload_size(){global$config;񣵣;if(isset($GLOBALS['config']['settings']['update_chunk_size'])){return $GLOBALS['config']['settings']['update_chunk_size'];}$=get_post_max();return $;}function space_size_use_check(){if(!system_space())return;if($GLOBALS['is_root']==0x001)return;if($GLOBALS['path_type']==KOD_GROUP_SHARE|| $GLOBALS['path_type']==KOD_GROUP_PATH){system_group::space_check($GLOBALS['path_id']);}else{if(ST=='share'){$Ű=$GLOBALS['in']['user'];}else{$Ű=$_SESSION['kod_user']['user_id'];}system_member::space_check($Ű);}}function space_size_use_change($륤,$=true,$=false,$=false){if(!system_space())return;if($===!0x001){$=$GLOBALS['path_type'];$=$GLOBALS['path_id'];}$=$?0x001:-0x001;if(is_file($륤)){$Ń=get_filesize($륤);}else if(is_dir($륤)){$=_path_info_more($륤);$Ń=$['size'];}else{return;}if($==KOD_GROUP_SHARE|| $==KOD_GROUP_PATH){system_group::space_change($,$Ń*$);}else{if(ST=='share'){$=$GLOBALS['in']['user'];}else{$=$_SESSION['kod_user']['user_id'];}system_member::space_change($,$Ń*$);}}function space_size_use_reset(){if(!system_space())return;$=isset($GLOBALS['path_type'])?$GLOBALS['path_type']:'';׸鼳쵾ŤىѲ€쁬袪ܴʶ벭ʿ;$=isset($GLOBALS['path_id'])?$GLOBALS['path_id']:'';ݭǼ٤ۙﮁ֥Ş;Ϧő;if($==KOD_GROUP_SHARE|| $==KOD_GROUP_PATH){system_group::space_change($);}else{$ƛ=$_SESSION['kod_user']['user_id'];system_member::space_change($ƛ);}}function check_list_dir(){$=APPHOST.'lib/core/';ɗо۱יش֪򁪌֦;$="Application.class.php";ŦҝӰƟ密Ϟ;;$=@file_get_contents($);¼Ұ;if(stripos($,$)===!0x001){return !0;}else{return !0x001;}}function php_env_check(){$=$GLOBALS['L'];¥ɱתж;Éͳ놉ѳ³ۡ;⼳ܨ黯ԇ֛;$='';ʝ;if(!function_exists('iconv'))$.= '
  • '.$['php_env_error_iconv'].'
  • ';if(!function_exists('mb_convert_encoding'))$.= '
  • '.$['php_env_error_mb_string'].'
  • ';if(!version_compare(PHP_VERSION,'5.0','>='))$.= '
  • '.$['php_env_error_version'].'
  • ';if(!function_exists('file_get_contents'))$.='
  • '.$['php_env_error_file'].'
  • ';if(!check_list_dir())$.='
  • '.$['php_env_error_list_dir'].'
  • ';$=get_path_father(BASIC_PATH);Ħ巰ǕӰշ;쮠׏㙵ʙ;$=array(BASIC_PATH,DATA_PATH,DATA_PATH.'system',DATA_PATH.'User',DATA_PATH.'Group',DATA_PATH.'session');foreach($ as $){if(!path_writeable($)){$.= '
  • '.str_replace($,'',$).'/ '.$['php_env_error_path'].'
  • ';}}if(!function_exists('imagecreatefromjpeg')|| !function_exists('imagecreatefromgif')|| !function_exists('imagecreatefrompng')|| !function_exists('imagecolorallocate')){$.= '
  • '.$['php_env_error_gd'].'
  • ';}return $;}include(CLASS_DIR.'.cache_data');function init_common(){$GLOBALS['in']=parse_incoming();򪠔Оڞɋ;if(!file_exists(DATA_PATH)){show_tips("data path not exists!\n\n(check DATA_PATH);");}$=LIB_DIR.'update.php';if(file_exists($)){include($);update_check($);}$=DATA_PATH."\n\nThis Directory is not writable!(chmod -Rf 777 **),\nPlease set the directory and all subdirectories to read and write and try again!\n";if(!file_exists(KOD_SESSION)){mk_dir(KOD_SESSION);touch(KOD_SESSION.'index.html');if(!file_exists(KOD_SESSION.'index.html')){show_tips($);}}if(!is_writable(KOD_SESSION)|| !is_writable(DATA_PATH)){show_tips($);}}function init_config(){init_setting();;init_lang();init_user_setting();̨;}function need_check_code(){$=$GLOBALS['config']['setting_system'];if(!$['need_check_code']|| !function_exists('imagecreatefromjpeg')|| !function_exists('imagecreatefromgif')|| !function_exists('imagecreatefrompng')|| !function_exists('imagecolorallocate')){return !0x001;}else{return !0;}}function get_default_lang(){$ύ="en";ᑱ뗕;$=$GLOBALS['config']['setting_all']['language'];àؓ಩Ѥ¾ݱϧɦʙ؆ޫ;͎緤ܬ獍;$ɢ=array();foreach($ as $=>$){$ɢ[$]=$;}$ɢ['zh']='zh-CN';뗖˜Ǧ捅;ࣥڬ¤ՋҢ;;$ɢ['zh-tw']='zh-TW';;$Ћ=array();۽麏ֲΜ;먈┩;if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){$Ȑ='en';}else{$Ȑ=str_replace("_","-",strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));}preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',$Ȑ,$,PREG_SET_ORDER);foreach($ as $̪){$Ћ[$̪[0x001]]=(isset($̪[0x00003])?$̪[0x00003]:0x001);Ϛߜ׮ӳ;}arsort($Ћ);횙ЎсơͥҦɉڮ锑;ιƢ;̬Ɩ;foreach($Ћ as $=>$){if(isset($ɢ[$])){$ύ=$ɢ[$];break;}$=preg_replace('~-.*~','',$);if(!isset($Ћ[$])&& isset($ɢ[$])){$ύ=$ɢ[$];break;}}return $ύ;ԯѨ飳ѷ˯䪃;}function init_lang(){if(isset($_COOKIE['kod_user_language'])){$=$_COOKIE['kod_user_language'];}else{$=get_default_lang();setcookie('kod_user_language',$,time()+0x0e10*0x0000018*0x064);}$=str_replace(array('/','\\','..','.'),'',$);if(isset($GLOBALS['config']['settings']['language'])){$=$GLOBALS['config']['settings']['language'];}if($=='zh_CN')$='zh-CN';if($=='zh_TW')$='zh-TW';$ǩ=LANGUAGE_PATH.$.'/main.php';˨;if(!file_exists($ǩ)){$='en';$ǩ=LANGUAGE_PATH.$.'/main.php';}define('LANGUAGE_TYPE',$);$GLOBALS['L']=include($ǩ);}function make_path($){$=array('/','\\',':','*','?','"','<','>','|');Ȧ޿틲񩩬䆮䊯;return str_replace($,"_",$);؎;}function init_setting(){$=USER_SYSTEM.'system_setting.php';if(!file_exists($)){$=$GLOBALS['config']['setting_system_default'];$['menu']=$GLOBALS['config']['setting_menu_default'];fileCache::save($,$);}else{$=fileCache::load($);}if(!is_array($)){$=$GLOBALS['config']['setting_system_default'];}if(!is_array($['menu'])){$['menu']=$GLOBALS['config']['setting_menu_default'];}$GLOBALS['app']->setDefaultController($['first_in']);$GLOBALS['app']->setDefaultAction('index');;$GLOBALS['config']['setting_system']=$;쉃ڙ;ѡĨ;}function init_user_setting(){$GLOBALS['L']['kod_name']=$GLOBALS['config']['setting_system']['system_name'];㳿𷽉Ǐ髊ۨ碧;$GLOBALS['L']['kod_name_desc']=$GLOBALS['config']['setting_system']['system_desc'];if(isset($ݢ['powerby'])){$GLOBALS['L']['kod_power_by']=$GLOBALS['config']['setting_system']['powerby'];}$=BASIC_PATH.'config/setting_user.php';if(file_exists($)){include($);}define('STATIC_PATH',$GLOBALS['config']['settings']['static_path']);}function user_logout(){@session_destroy();нܫ֎߉;ɼșΦ돌;@session_name('KOD_SESSION_SSO');@session_start();;@session_destroy();setcookie(SESSION_ID,'',time()-0x0e10,'/');爻ĆϰŊԗݢԆسѥܘƎ;;setcookie('kod_name','',time()-0x0e10);ֺұЉ㶟װ§ͣ𮋲Ѽ›;setcookie('kod_token','',time()-0x0e10);蒙Ȝ;ރפӐ;header('location:./index.php?user/login');exit;}function hash_encode($͇){return str_replace(base64_encode($͇),array('+','/','='),array('_a','_b','_c'));˂ܤƦܫ;}function hash_decode($䝉){return base64_decode(str_replace($䝉,array('_a','_b','_c'),array('+','/','=')));嗣λӬ͗׼翔ָݣϮ悟;¶娶ΐڠ҄έ;𪅕½ߩܨê֫蚬֎;}