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';͹;;$=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($){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']:'';dzѠ່ǟ;$=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)|| !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('+','/','=')));;}