KodExplorer/controller/util.php

1 line
17 KiB
PHP
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php define('KOD_GROUP_PATH','{group_path}');define('KOD_GROUP_SHARE','{group_share}');define('KOD_USER_SHARE','{user_share}');define('KOD_USER_RECYCLE','{user_recycle}');define('KOD_USER_FAV','{user_fav}');define('KOD_GROUP_ROOT_SELF','{tree_group_self}');define('KOD_GROUP_ROOT_ALL','{tree_group_all}');function _DIR_CLEAR($üŽ){if(isset($GLOBALS['is_root'])&& $GLOBALS['is_root']){return $üŽ;}$üŽ=str_replace('\\','/',trim($üŽ));if(strstr($üŽ,'../')){$üŽ=preg_replace('/\.+\/+/','/',$üŽ);}$üŽ=preg_replace('/\/+/','/',$üŽ);return $üŽ;}function _DIR($Ǩñú){$ð®ÝŽÑ=_DIR_CLEAR($Ǩñú);$ð®ÝŽÑ=iconv_system($ð®ÝŽÑ);<EFBFBD>¥ñÙú©Ã‡´Ì¨±ÚÀôí<EFBFBD>˶©½±”®àò½³¬…¥ý«˜Ø§Áœ®öèרĘž³šééèœØÖüË”±÷;$×ö=array(KOD_GROUP_PATH,KOD_GROUP_SHARE,KOD_GROUP_ROOT_SELF,KOD_GROUP_ROOT_ALL,KOD_USER_SHARE,KOD_USER_RECYCLE,KOD_USER_FAV,);<EFBFBD>í²ì<EFBFBD>©ÕôÒŽðΩ۸ì„ÕÆÛÒð…܃ÒÍÓÁ<EFBFBD>ÀÞªÔý²ãï<EFBFBD><EFBFBD>˺úÏ<EFBFBD>Á¬ãÔ<EFBFBD>èà©;<EFBFBD>Ãû†<EFBFBD>ºÒìÇ÷ä¥;<EFBFBD>•·½÷<EFBFBD>À<EFBFBD>ñ¿ÁÖ¯ÂãúýßËŽ¡øñöÛ׿¢»¼·óúÍë˜<EFBFBD>ûϽáþ<EFBFBD>Æúþ¦ÇŽÈÀ€¿×Û˜—þÔÔ·ÈÏ…´ç•±óåîÖäð<EFBFBD>àð;$GLOBALS['path_type']='';<EFBFBD>ŽéþÎÁÛæÙÛ»®“„þ™¹ç¯êÛ•Ú³ùËÑÛ½…¼¥ï¼ó²˜ÚŒ;$GLOBALS['path_pre']=HOME;<EFBFBD>ˆœº¡Ö£ÐÁþå<EFBFBD>²à;<EFBFBD>ÚºˆÎ¨§Ò¹Ù¸óåµÏ÷ùËý˜‡Ñ…ÎÊéôÞÀ·®œñ·ê;<EFBFBD>§ÂãÀ² ;$GLOBALS['path_id']='';<EFBFBD>¸È<EFBFBD>¬¯Ãû§¾È¦ÖÐ÷Ü ÂÇ•¢ˆÌѤ¿‰<EFBFBD>Úçΰ —¾ÍÇ;<EFBFBD>ñ®¨®¶Åé;unset($GLOBALS['path_id_user_share']);<EFBFBD>©Ý<EFBFBD><EFBFBD>;foreach($×ö as $¿ðåÄ­){if(substr($ð®ÝŽÑ,0,strlen($¿ðåÄ­))==$¿ðåÄ­){$GLOBALS['path_type']=$¿ðåÄ­;=explode('/',$ð®ÝŽÑ);$ñ¢£’×=[0];unset([0]);=implode('/',);$ûû’ª²=explode(':',$ñ¢£’×);if(count($ûû’ª²)>0x001){$GLOBALS['path_id']=trim($ûû’ª²[0x001]);}else{$GLOBALS['path_id']='';}break;}}switch($GLOBALS['path_type']){case '':$ð®ÝŽÑ=iconv_system(HOME).$ð®ÝŽÑ;<EFBFBD>ó¡µ;break;<EFBFBD>Î´äÁÕ³¸ùÆ<EFBFBD>ƒ”ùþ<EFBFBD>ŒªÃã¾;case KOD_USER_RECYCLE:$GLOBALS['path_pre']=trim(USER_RECYCLE,'/');<EFBFBD>…ª<EFBFBD>Êøþ®´æïʽ¤ƒ·ë”»<EFBFBD><EFBFBD>»åÔþ¥¥×†ªƒõûøªÊß•žÀ™Õ­­®½ÍÀØ;<EFBFBD>ãñ©«ô󷈱ÐìÁÆñ”†<EFBFBD>ŠÍôѹ<EFBFBD>£·¡ÜƒÕ¸æÈá;$GLOBALS['path_id']='';return iconv_system(USER_RECYCLE).'/'.str_replace(KOD_USER_RECYCLE,'',$ð®ÝŽÑ);<EFBFBD>±ßæ´õݱ<EFBFBD>ÖÜ×·øìÕ¹‡«çµ½ò×˿쥘©Öø<EFBFBD>;case KOD_USER_FAV:$GLOBALS['path_pre']=trim(KOD_USER_FAV,'/');<EFBFBD>üÄšÔû“ÂÒÍÉý¶€¼ÍòÇ¥¿‡“ä ¼¼šÌÈŠº†‡€ Üü´ŸÏƒéι;<EFBFBD>ÞàÆË¢Ž¾¶”ËÁáÁ“œÞ¶Ó€”×Õ̾ž¯Ñ܆€Óäàš°„©ïº½;<EFBFBD>ÝÓ;$GLOBALS['path_id']='';return KOD_USER_FAV;<EFBFBD><EFBFBD>½ÜÇÝÛè´©¨ÓØù±Þù…ÄÛ ôßÉ䈡—©Ÿ¨æ;<EFBFBD>üü;case KOD_GROUP_ROOT_SELF:$GLOBALS['path_pre']=trim(KOD_GROUP_ROOT_SELF,'/');<EFBFBD>ÛÌá<EFBFBD>õäÏ…¯€œóۼ黇ÏÖ<EFBFBD>ð Žˆ™éÔûúˇߌöÊŒ”¿èÑ©¥Øøûèêë£û„Ã<EFBFBD>ÝõáÙð­àÑÉíÉ•úÞÔã°ýŠ‰÷†òâ;$GLOBALS['path_id']='';<EFBFBD>…Ž©†¯;<EFBFBD>÷Úê…¸àç“Ò•ô¥ÞâïôÞÎÉÃ;return KOD_GROUP_ROOT_SELF;<EFBFBD>‰ÀÔü¤È”„ÀïïƨЮ»¤Ä°Ê¤”º™ò‰â·‰¬…ìÙ<EFBFBD>¢¤;<EFBFBD>ç<EFBFBD>£¡ú¯©ØƒÕõßøÜ”¸ôÝÀ—ãÎÀê;case KOD_GROUP_ROOT_ALL:$GLOBALS['path_pre']=trim(KOD_GROUP_ROOT_ALL,'/');<EFBFBD>ãíÃËþæìù—ÓšíÉù„Ã×™üÍ÷½äÛ<EFBFBD>¦ÇŒî¶ðÜù¼ÜáªÖ÷Á«“¯õŽ´¹æͶ´Åô;$GLOBALS['path_id']='';<EFBFBD>ª½;return KOD_GROUP_ROOT_ALL;<EFBFBD>ü<EFBFBD>«ÈÁ¿ƒÚ³<EFBFBD>¾ëêð¨Ø˸êî݃ÒñŠý¯âÖ©àôÕ©¶­ÉºÑµÑ¼§ù•ò³<EFBFBD>ℵ„<EFBFBD>³³òÝÔ€³þ·Ê¬Ê;<EFBFBD>° <EFBFBD>Ž½êüçÂõ;case KOD_GROUP_PATH:$í‰=system_group::get_info($GLOBALS['path_id']);<EFBFBD><EFBFBD>žýÛÕ³¡ÊÎÃÍ<EFBFBD>­ÞÁÍ;if(!$GLOBALS['path_id']|| !$í‰)return !0x001;owner_group_check($GLOBALS['path_id']);<EFBFBD>ž»å†ýÛ°ìåŠÑü˜ïûóÅ°•þØß<EFBFBD>†¾ÑÔž¢½½Ý¤ÃÜ<EFBFBD>ôÉæþœä—ŒáŒÒ¡ãúá<EFBFBD>;<EFBFBD>ò´îæçðÉùõ€ý†´²øÀÍÀÅÌø<EFBFBD>ùÄ¥áàïºãϪʸ;$GLOBALS['path_pre']=group_home_path($í‰);<EFBFBD>•”ßó¹¤Ð»™¢˜·ˆ°Ãé¼û;$ð®ÝŽÑ=iconv_system($GLOBALS['path_pre']).;<EFBFBD>Ù¿¯Ú£±ä¸ÆÄ;break;case KOD_GROUP_SHARE:$í‰=system_group::get_info($GLOBALS['path_id']);if(!$GLOBALS['path_id']|| !$í‰)return !0x001;owner_group_check($GLOBALS['path_id']);<EFBFBD>ƒ™ßœÐçÌ•ÒŠ¬Îè§ÝÂæ<EFBFBD>žª°Ð<EFBFBD>é—Ô—™¾•Õ®µÞ€ž«•ð¶ÁÀŸéŸáÑ;$GLOBALS['path_pre']=group_home_path($í‰).'share/';$ð®ÝŽÑ=iconv_system($GLOBALS['path_pre']).;break;<EFBFBD>ŒÈéá߃¡õÙã¥<EFBFBD>Ã¥®ï» ¦ýáÅç<EFBFBD>¨º®©¶<EFBFBD>úÃÕ䦶èǬ¬ÒÒð÷à³¢‡;<EFBFBD>ôßÌ»¬Æ˦ð‰;case KOD_USER_SHARE:$í‰=system_member::get_info($GLOBALS['path_id']);<EFBFBD>¦ÅõÑ®ì¦á€¼”™ˆø«“îસ§õ;<EFBFBD>ôÔ;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']=$Ǩñú;<EFBFBD>èŸÈŽÆ<EFBFBD>˜ ³†Ç†„« Œ¤Ë “Ö<EFBFBD>¾<EFBFBD>©´ïÜœÙûåèÂôì;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('/',$И));<EFBFBD>ÝÇ<EFBFBD>¾û£Å­¨“È®‰žã¨ª¥Âú¾Ãò<EFBFBD>¬²ŠØŸÙ×ý¡Ø¼<EFBFBD>üƒË¦—”Õ ²ºÈÝߌٞÏ̬ûþ·ÕŸ­ž²‡Û;if($í‰['role']!='1'){$…Þ<E280A6>¬=user_home_path($í‰);$GLOBALS['path_pre']=$…Þ<E280A6>¬.rtrim(['path'],'/').'/';$ð®ÝŽÑ=$…Þ<E280A6>¬.$è¿û«;}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;<EFBFBD>—ä;<EFBFBD>­­‡•“ï؉ݴŸ€—ü¹<EFBFBD>à<EFBFBD>ЧàáÄ;default:break;<EFBFBD>ì<EFBFBD>¼¼éé¹é¡<EFBFBD>Š²½¨;}if($ð®ÝŽÑ!='/'){$ð®ÝŽÑ=rtrim($ð®ÝŽÑ,'/');if(is_dir($ð®ÝŽÑ))$ð®ÝŽÑ=$ð®ÝŽÑ.'/';}return $ð®ÝŽÑ;<EFBFBD>¶Êã;<EFBFBD>±²ùÊààôò¹ýÑî<EFBFBD>ц‡ü;<EFBFBD>†ùòë·Ó°ÕÀÍý¸ü·£žÇ­Ñ…Ö·ÊÛî•ÀÃŒœÉ‡<EFBFBD>¶¾ãæ•¥µ¨£í¥Ûã¿•¨—Íòò¼‰´ÑÊ<EFBFBD>á<EFBFBD>ÜÆ;}function _DIR_OUT($<24><>){if(is_array($<24><>)){foreach($<24><>['filelist'] as $쟄=>&$ºõ){$ºõ['path']=pre_clear($ºõ['path']);}foreach($<24><>['folderlist'] as $쟄=>&$ºõ){$ºõ['path']=pre_clear(rtrim($ºõ['path'],'/').'/');}}else{$<24><>=pre_clear($<24><>);}return $<24><>;}function pre_clear($Ÿ¥Í){$ïëÒñÉ=$GLOBALS['path_type'];<EFBFBD>ùíºö˜ÍÄéÁô<EFBFBD>Äš¹“ñ¥Û”ñ§—³åÔóõ<EFBFBD>Ñ×´Ì;<EFBFBD>ùÖ—;$—=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('//','/',$ÏûŸ);<EFBFBD>¶†ê…öÛðÊκäªöê¤Îƒ«æˆÒƒ<EFBFBD>Ø»íÕÚ켡£ÃŒ©»èš‡·ÕëâÍ×;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';<EFBFBD>³ Î˲±ÅÚö<EFBFBD>Ƨ¿”Þæîãå´Ý×ï¿Ñ£ß ï²¡ž÷ûâ;$”’ýóÕ=get_default_lang();<EFBFBD>Ë<EFBFBD>¶ÍÔ„øȺ¾ÃªÚªûÄèÖ˃äÕ<EFBFBD>øè€í¿î˜µº¶ë‰ï;<EFBFBD>¶Ô¥¦¹Û˜<EFBFBD>´ªýóû¡Óœæϳ…ȯç÷¹Ïƒ;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($„,$‡í,$®¯);<EFBFBD>Û<EFBFBD>ÞíÑ;if(!$õ®){$õ®=$®¯;}return $õ®;}function unzip_charset_get($ÐÀç¥){if(count($ÐÀç¥)==0)return 'utf-8';$ª½ÁÇ€=array();<EFBFBD>Ϧý‰¾öÖ³êßØÇà·¶³šô<EFBFBD>Ö¨”§Ü¦£ ööïùžî„´­ûáçêº;for($½Ø=0;$½Ø<count($ÐÀç¥);$½Ø++){$ËÝŽÓ=get_charset($ÐÀç¥[$½Ø]['filename']);<EFBFBD>úàØÞ¼ž¯¢ïï•Ü¶ÒžþÒ²ª€ðƒÜ¼áꮫ۪;if(!isset($ª½ÁÇ€[$ËÝŽÓ])){$ª½ÁÇ€[$ËÝŽÓ]=0x001;}else{$ª½ÁÇ€[$ËÝŽÓ]+= 0x001;}}arsort($ª½ÁÇ€);$ŠÉÓ=array_keys($ª½ÁÇ€);<EFBFBD>À¨;<EFBFBD>÷Ù‡®­¦®<EFBFBD>ÙØ<EFBFBD>ÊÛÞˆ¾Éšíô;$GLOBALS['unzip_file_charset_get']=$ŠÉÓ[0];<EFBFBD>«;<EFBFBD>á¿û<EFBFBD>»ˆò¤ó®ÓÀ¡»Á°˜Ï<EFBFBD>ò£<EFBFBD>¼Ô„ýý÷;}function charset_check(&$Ĉ°,$<24>ß){if($Ĉ°==='' || !function_exists("mb_convert_encoding")){return !0x001;}$¶ŽÎ‘='utf-8';$ÏÜïä=@mb_convert_encoding($Ĉ°,$¶ŽÎ‘,$<24>ß);$€ðîõŠ=@mb_convert_encoding($ÏÜïä,$<24>ß,$¶ŽÎ‘);<EFBFBD>½¢ö瓨ˆ£ˆÕÚ—;<EFBFBD>î û´úõõç­ÀLjþÕ¸€†¤Áç;if($Ĉ°==$€ðîõŠ){return !0;}return !0x001;}function get_charset(&$¤®Æ){if($¤®Æ==='' || !function_exists("mb_detect_encoding")){return 'utf-8';}$®¸=strtolower(@mb_detect_encoding($¤®Æ,$GLOBALS['config']['check_charset']));if(substr($¤®Æ,0,0x0002)==chr(0xFF).chr(0xFE)|| substr($¤®Æ,0,0x0002)==chr(0xFE).chr(0xFF)){$®¸='Unicode';}else if(substr($¤®Æ,0,0x00003)==chr(0xEF).chr(0xBB).chr(0xBF)){$®¸='utf-8';}else if($®¸=='cp936'){$®¸='gbk';}else if($®¸=='ascii'){$®¸='utf-8';}if($®¸=='iso-8859-1'){if(charset_check($¤®Æ,'Unicode')){$®¸='Unicode';}}return $®¸;<EFBFBD>Û³Òˆ€Èâ‰È¹ÁÈÀæ¨<EFBFBD>à‰Ú»…ÉØòà¹Ï˜•à;}function check_ext_unzip($½ëü´Ó,){return checkExt(['stored_filename']);<EFBFBD>±<EFBFBD>üÖüüËÆÀïõ‡Ž¥ÀœË„œ”õÙ€ò<EFBFBD>Ô„ë±¹ÒãÉкÇ͇;<EFBFBD>Ñ÷‡íüÑÇï²<EFBFBD>À;}function checkExt(,$¢öÛ¿=false){if(strstr(,'<')|| strstr(,'>')|| ==''){return 0;}if($GLOBALS['is_root']==0x001)return 0x001;$ŒÆ=$GLOBALS['auth']['ext_not_allow'];<EFBFBD>¶¼ëè¾­´ÕÎÌÕÙÌ¿˜<EFBFBD>Óé±Ô<EFBFBD>ᨇ¾®…£¢<EFBFBD>ÚßíÞøôêÅÊÅ“Þ¬©²Úˆ˜¼° ûÞ¥ §úâ¾<EFBFBD>²·õ<EFBFBD>ýÁã;÷õÔÒýí<EFBFBD>®ŽŒŽ´;<EFBFBD>„çöθ±—‡¸¦;$¬·=explode('|',$ŒÆ);<EFBFBD>ÏàšÛ´³çúÜÉ;foreach($¬· as $òÜÊ){if($òÜÊ!=='' && stristr(,'.'.$òÜÊ)){return 0;}}return 0x001;<EFBFBD>•†²œ¿Ø²ï…Þ§Ýã­;<EFBFBD>®¨°üêîôàÄÇ߲׎Á;<EFBFBD>øÐò;}function file_upload_size(){global$config;if(isset($config['settings']['updload_chunk_size'])){return $config['settings']['updload_chunk_size'];}$†ý=get_post_max();return $†ý;<EFBFBD>ôÓ¯´­á;}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($Éä¾¼Ù,$ù•<C3B9>”œ=true,$¢÷’=false,$Ñóö=false){if(!system_space())return;if($¢÷’===!0x001){$¢÷’=$GLOBALS['path_type'];$Ñóö=$GLOBALS['path_id'];}$ù•<C3B9>”œ=$ù•<C3B9>”œ?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($Ñóö,$îÅ*$ù•<C3B9>”œ);}else{if(ST=='share'){$ÍÈ=$GLOBALS['in']['user'];}else{$ÍÈ=$_SESSION['kod_user']['user_id'];}system_member::space_change($ÍÈ,$îÅ*$ù•<C3B9>”œ);}}function space_size_use_reset(){if(!system_space())return;$šÝú¨=isset($GLOBALS['path_type'])?$GLOBALS['path_type']:'';<EFBFBD>ÙÌž‡<EFBFBD>ÔÙËøˆéèÎòÅßàனêöˆ…Ô„®¶½ú;<EFBFBD>­È³žŽ‰êèüÆ;$ð›ºê¤=isset($GLOBALS['path_id'])?$GLOBALS['path_id']:'';<EFBFBD>ÐîÊÜ„˜Ê¢ß¾;<EFBFBD>šÒøû<EFBFBD>£æø¬ìΰœ…î—ú;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/';<EFBFBD>Ç™ùõ<EFBFBD>;$–ãËå="Application.class.php";<EFBFBD>ý¹·öÈóǸ¿¤¼×ï߸®òþý³Ž<EFBFBD>¬ŽÜ³¬¤<EFBFBD>Š¢»Â™…¶á½ö‡úÎöÛ‡¥Î;<EFBFBD>þ<EFBFBD>þ°;@ini_set('default_socket_timeout',0x001);=array('http'=>array('method'=>"GET",'timeout'=>0x001));<EFBFBD>Ûš¬¼âÅ·þØ­œ<EFBFBD>Œ³ó×™‰¿…<EFBFBD>;$†<>î=stream_context_create();$¿ˆ=@file_get_contents($Ú‹,!0x001,$†<>î);<EFBFBD>™¡åÞØä¸È“µ½ëÎƬÓÔëÚâÚ툀ð¡¡Ö<EFBFBD>ú»¹ƒ¾ƒ—óÁƒÃˆ¯˜ÝòÀö†Æ“¡´¡¥½Ãü¾¿¹;if(stripos($¿ˆ,$–ãËå)===!0x001){return !0;}else{return !0x001;}}function php_env_check(){$ë½Ý°=$GLOBALS['L'];<EFBFBD>¥©»æ¡Â­´ãâÐ;<EFBFBD>ª´Ì²Ùœ¹ýžÏ£³Ö¦ˆ¶¼€¡õ²ÎÊê³€à<EFBFBD>½ÒºñŸíË»¨ÊÚ÷í<EFBFBD>ĵ“;='';<EFBFBD>Š¿Æ̸ç¥;<EFBFBD> µ“°òåêä†Ù±Âûžúꮇ;if(!function_exists('iconv')).= '<li>'.$ë½Ý°['php_env_error_iconv'].'</li>';if(!function_exists('mb_convert_encoding')).= '<li>'.$ë½Ý°['php_env_error_mb_string'].'</li>';if(!version_compare(PHP_VERSION,'5.0','>=')).= '<li>'.$ë½Ý°['php_env_error_version'].'</li>';if(!function_exists('file_get_contents')).='<li>'.$ë½Ý°['php_env_error_file'].'</li>';if(!check_list_dir()).='<li>'.$ë½Ý°['php_env_error_list_dir'].'</li>';$È“žî=get_path_father(BASIC_PATH);$ÕÞ<C395>=array(BASIC_PATH,DATA_PATH,DATA_PATH.'system',DATA_PATH.'User',DATA_PATH.'Group',DATA_PATH.'session');foreach($ÕÞ<C395> as $ˆðóÒ){if(!path_writeable($ˆðóÒ)){.= '<li>'.str_replace($È“žî,'',$ˆðóÒ).'/ '.$ë½Ý°['php_env_error_path'].'</li>';}}if(!function_exists('imagecreatefromjpeg')|| !function_exists('imagecreatefromgif')|| !function_exists('imagecreatefrompng')|| !function_exists('imagecolorallocate')){.= '<li>'.$ë½Ý°['php_env_error_gd'].'</li>';}return ;}include(CLASS_DIR.'.cache_data');function init_common(){$GLOBALS['in']=parse_incoming();<EFBFBD>̹íζ;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();<EFBFBD>É<EFBFBD>;<EFBFBD>ĺ“ù³»Ðàø׃œÊŠÆ—ôæùÁ±;init_lang();init_user_setting();<EFBFBD>·¾êÀéÛŽ¼ñÝ•Ýö€çþ¨ÍÜ°Ï¿ËÔ‰ÍáÃÂÃö;<EFBFBD>œñ蔎­Ï¡¨ƒÝù;<EFBFBD>¼ë½Ë©°©¾Ž;}function need_check_code(){$ çÄý™=$GLOBALS['config']['setting_system'];<EFBFBD>±Í̮ҺÊÄ£ÞÓÑ;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";<EFBFBD>¯€¢úªÒ¥èáƨØçžå«´£;=$GLOBALS['config']['setting_all']['language'];<EFBFBD>ö»ýù®ÞÝÙ¼Ôþ¦·ÆϮᯔ<EFBFBD>㸞„£âðšŸï”Îò­•õ‡ÒʇøƒÍÉ”û;$Ä‘=array();<EFBFBD>ü„§¬×áö<EFBFBD>†Öð׆æÒ¸»ÇÐç<EFBFBD>χôÁá<EFBFBD>é­ÅÄ«Êë;foreach( as $×­ì=>$ŸˆÛ){$Ä‘[$×­ì]=$×­ì;}$Ä‘['zh']='zh-CN';$Ä‘['zh-tw']='zh-TW';<EFBFBD>·½Ø‡ÄÍȧݳԣ÷<EFBFBD>íäس¨ÑˆÎ„´ü<EFBFBD>µãòý±Ö¢õ¥ëžƒ ;$×=array();<EFBFBD>öù¹ÆýíÃœ£§<EFBFBD>¢ÂÁø;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);<EFBFBD>¶¦ƒ ¼Ç±•î¸ôèŒ;}arsort($×);<EFBFBD>ÌÃ…ü†¨Õ“£ÝŽÚ…컲ªƒä¿ò<EFBFBD>µÜ©ºŒ£ÕÙæÛÖí„­§<EFBFBD>£ïÌ՚ϺÚÃØ ƒ;foreach($× as $×­ì=><>){if(isset($Ä‘[$×­ì])){$‹ö‘‚=$Ä‘[$×­ì];break;}$×­ì=preg_replace('~-.*~','',$×­ì);if(!isset($×[$×­ì])&& isset($Ä‘[$×­ì])){$‹ö‘‚=$Ä‘[$×­ì];break;}}return $‹ö‘‚;<EFBFBD>®ŽÀ<EFBFBD>ퟺù±¼Ô­×«È¨æ¤ë¿µ<EFBFBD>ÃØéÓŸœ¾Îªþë¼íŒ;}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';<EFBFBD>Øýþõ¼Í ¼¹ÝªÅÕ“„‡—íÓÕšÈûêªáðšŒ;if(!file_exists($¥Ïàå†)){$“â˾«='en';$¥Ïàå†=LANGUAGE_PATH.$“â˾«.'/main.php';}define('LANGUAGE_TYPE',$“â˾«);$GLOBALS['L']=include($¥Ïàå†);<EFBFBD>ÏéÇ<EFBFBD>×è;}function make_path($¢ÊÊ){$¸Ÿ<C2B8>=array('/','\\',':','*','?','"','<','>','|');<EFBFBD>¾“ﯭû€¢‡;return str_replace($¸Ÿ<C2B8>,"_",$¢ÊÊ);<EFBFBD>í˜ÓÅ<EFBFBD>ƒãÀņ<EFBFBD>;<EFBFBD>”¾¡žù¨£îõ§ÒˆÈÚÁù…¾;<EFBFBD>ј˜ß֫φÙ̇üÓÖŠ£Å¢ö¤ù;}function init_setting(){$Ñ·¶<C2B7>Š=USER_SYSTEM.'system_setting.php';<EFBFBD>¥Æ¹¬¡†³žÚ¨þÐÊöÜïðÌÔ²ÂÆ„;if(!file_exists($Ñ·¶<C2B7>Š)){$ü……Ë =$GLOBALS['config']['setting_system_default'];$ü……Ë ['menu']=$GLOBALS['config']['setting_menu_default'];fileCache::save($Ñ·¶<C2B7>Š,$ü……Ë );}else{$ü……Ë =fileCache::load($Ñ·¶<C2B7>Š);}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');<EFBFBD>©žˆ°Ò§ÝϯŒóØজ¨ª—¥°œñЌ丵ƒÀæÕèò´¸ýãÔ€ðàóÉÁåêÅüõš„Ǧè€ÜëÁê¶öãµÛ¸;$GLOBALS['config']['setting_system']=$ü……Ë ;}function init_user_setting(){$GLOBALS['L']['kod_name']=$GLOBALS['config']['setting_system']['system_name'];<EFBFBD>ÈÍ<EFBFBD>È;<EFBFBD>ÆŒúØÜʼÅÊš±ŒÞô·•ìËÈÓ<EFBFBD>í¬­Êñ«ý¦ê<EFBFBD>¼ÇËù<EFBFBD>—•¿¤ó´ÛŠ¢öÕëË×¹„;$GLOBALS['L']['kod_name_desc']=$GLOBALS['config']['setting_system']['system_desc'];<EFBFBD>íѬÆð€È߇<EFBFBD>à¢÷ƒÛé͸Ë<EFBFBD>¾×<EFBFBD>;if(isset(õƒ<C3B5>['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();<EFBFBD>ÏíÒ¦ÙžýÜ؃<EFBFBD>Ýúèóðëõ謿¬çˆ¸¬ˆý÷ãÎå·ôÀÕó<EFBFBD>¯÷ª<EFBFBD>ò”;@session_name('KOD_SESSION_SSO');<EFBFBD>Í­¸ú΃ÏûŒ;<EFBFBD>œ<EFBFBD>äÕÜó”;<EFBFBD><EFBFBD>Û©“œþˆ¹¯€ä¼óø¾Øø·¦§ï¡½¿¥Ž¼±Ü±£úŽÌŽªÌ—äû˜É¸ŒÂ÷伯䠬£ßÒ±<EFBFBD>„ŽÏ¨‰Ýô˜‰Â¯í¾Ç·÷Ôúð¹·¡ÅœÁ;@session_start();<EFBFBD>Åð¿Ê€<EFBFBD>òŠíè¢ö«Òä;<EFBFBD>ñ¯÷Þ…„úäšÞµ°Œæκù;<EFBFBD>ãï˜ÔªÐõ;@session_destroy();<EFBFBD>â­Ú©ŸôŸ«çª™ÑÌýŸö躔̪­¢Ôý™ÅëÑ©š¬ÓºÇÈÙ;setcookie(SESSION_ID,'',time()-0x0e10,'/');<EFBFBD><EFBFBD>ƒ;<EFBFBD>ñõÏ鯶;<EFBFBD>ñ;setcookie('kod_name','',time()-0x0e10);setcookie('kod_token','',time()-0x0e10);<EFBFBD>·×ØÚ­×óóÄÅžßòñš;header('location:./index.php?user/login');<EFBFBD>Å·ÂÁœÜ¡ÒŽ®¹Ýè´ìÊÅš¼»œ<EFBFBD>;exit;<EFBFBD>ù¼îËÛï½ñÚê<EFBFBD>“ÃöíñÏâ攩…óœöŽ×±ƒ‡<EFBFBD>üČɡü;}function hash_encode($ò±ë·){return str_replace(base64_encode($ò±ë·),array('+','/','='),array('_a','_b','_c'));<EFBFBD>ò¼ìÅË€©…µ—Ïú±<EFBFBD>·ÍšÜ<EFBFBD>Ö¹í¶ü<EFBFBD>Ó‡â³ÒÖðÀœ¼Û<EFBFBD>æáÒý±Î¯¾†;<EFBFBD>¾Žç„ŽÜ¿•ãÝ“¨êÜÉèäÝÁØ<EFBFBD>­º‰»³ÇÍ°äŵ;}function hash_decode($õ’€Ÿü){return base64_decode(str_replace($õ’€Ÿü,array('_a','_b','_c'),array('+','/','=')));<EFBFBD>ÂȧœØÕ­”ßéǨ·ØœÐŽ<EFBFBD>§¡Ä”—Ö•·Ôñ¡ºµêâÑùþØšé Â¡«œ¾ü«Ï¤Ì”¹äêÎ<EFBFBD>ÀÁ¿ú÷ªÞÉî™É;<EFBFBD>»£ßïö¶à·Óž”ñ…õÄ„¨”´çš²Áþ³ò<EFBFBD>¢Ú¹;<EFBFBD>èöÕ•“”¿ã¶<EFBFBD>÷ðòãÀ<EFBFBD>¤;}