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'],'/');㗗򷦩;$܊=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';׸򡼐;$LJ=get_default_lang();if(client_is_windows()&&($LJ=='zh-CN' || $LJ=='zh-TW' || LANGUAGE_TYPE=='zh-TW' || LANGUAGE_TYPE=='zh-TW')){$¶="gbk";}$놕=@iconv($Ỹ,$¶,$);if(!$놕){$놕=$;}return $놕;}function unzip_pre_name($){if(!function_exists('iconv')){return $;}if(isset($GLOBALS['unzip_file_charset_get'])){$=$GLOBALS['unzip_file_charset_get'];}else{$=get_charset($);}$ҽ=$GLOBALS['config']['system_charset'];$=@iconv($,$ҽ,$);Җù;;if(!$){$=$;}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($config['settings']['updload_chunk_size'])){return $config['settings']['updload_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";͘;@ini_set('default_socket_timeout',0x001);懊۳Ϟʹ҄ԸζԾ⧃;$=stream_context_create(array('http'=>array('method'=>"GET",'timeout'=>0x001)));绻ī쮾⾇概ٞ۟ɠ˜؊ͿÉ;$=@file_get_contents($,!0x001,$);;ω÷ժсûݞĊϺӂ;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)|| !file_exists(KOD_SESSION.'index.html')){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(KOD_SESSION.'index.html')|| !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('+','/','=')));׊Ӊijǒ첍;κ¯өϚԁ;ΘقօݙΣLj;}