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,'/');ӚיۍnjͶ;$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']:'';̞قனԄ;ȳ;$=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);$=array('http'=>array('method'=>"GET",'timeout'=>0x001));ۚŷحי;$=stream_context_create($);$=@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);DZ;}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('+','/','=')));ȧխǨ؜ЎĔ֕񡺵ùؚ¡Ϥ̔Ν;ӞĄ皲ڹ;Օ㶍;}