33 if(!$ftp_info->ftp_host)
35 $ftp_info->ftp_host =
"127.0.0.1";
38 if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
40 $ftp_info->ftp_port =
'22';
43 $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
44 if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
46 return new BaseObject(-1,
'msg_ftp_invalid_auth_info');
48 $sftp = ssh2_sftp($connection);
51 $pin = $_SERVER[
'REQUEST_TIME'];
56 $path_info = array_reverse(explode(
'/',
_XE_PATH_));
57 array_pop($path_info);
58 $path_candidate = array();
61 foreach($path_info as $path)
63 $temp =
'/' . $path . $temp;
64 $path_candidate[] = $temp;
68 foreach($path_candidate as $path)
80 @ssh2_sftp_unlink($sftp, $path .
'ftp_check.html');
94 $this->
add(
'found_path', $found_path);
102 if(!$ftp_info->ftp_host)
104 $ftp_info->ftp_host =
"127.0.0.1";
107 if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
109 $ftp_info->ftp_port =
'22';
112 $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
118 $login_result = @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password);
121 ftp_close($connection);
122 return new BaseObject(-1,
'msg_ftp_invalid_auth_info');
126 $pin = $_SERVER[
'REQUEST_TIME'];
131 $path_info = array_reverse(explode(
'/',
_XE_PATH_));
132 array_pop($path_info);
133 $path_candidate = array();
136 foreach($path_info as $path)
138 $temp =
'/' . $path . $temp;
139 $path_candidate[] = $temp;
143 foreach($path_candidate as $path)
146 if(!ftp_put($connection, $path .
'ftp_check.html',
FileHandler::getRealPath(
'./files/cache/ftp_check'), FTP_BINARY))
155 ftp_delete($connection, $path .
'ftp_check.html');
169 $this->
add(
'found_path', $found_path);
180 require_once(
_XE_PATH_ .
'libs/ftp.class.php');
184 if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
186 return new BaseObject(1,
'msg_ftp_invalid_auth_info');
189 if(!$ftp_info->ftp_host)
191 $ftp_info->ftp_host =
'127.0.0.1';
194 if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
196 $ftp_info->ftp_port =
'21';
199 if($ftp_info->sftp ==
'Y')
201 if(!function_exists(
'ssh2_sftp'))
203 return new BaseObject(-1,
'disable_sftp_support');
208 if($ftp_info->ftp_pasv ==
'N')
210 if(function_exists(
'ftp_connect'))
214 $ftp_info->ftp_pasv =
"Y";
218 if(!$oFTP->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
223 if(!$oFTP->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
225 return new BaseObject(1,
'msg_ftp_invalid_auth_info');
229 $pin = $_SERVER[
'REQUEST_TIME'];
234 $path_info = array_reverse(explode(
'/',
_XE_PATH_));
235 array_pop($path_info);
236 $path_candidate = array();
239 foreach($path_info as $path)
241 $temp =
'/' . $path . $temp;
242 $path_candidate[] = $temp;
246 foreach($path_candidate as $path)
258 $oFTP->ftp_delete($path .
'ftp_check.html');
272 $this->
add(
'found_path', $found_path);
283 if(!$ftp_info->ftp_host)
285 $ftp_info->ftp_host =
"127.0.0.1";
287 $connection = ssh2_connect($ftp_info->ftp_host, $ftp_info->ftp_port);
288 if(!ssh2_auth_password($connection, $ftp_info->ftp_user, $ftp_info->ftp_password))
290 return new BaseObject(-1,
'msg_ftp_invalid_auth_info');
293 $sftp = ssh2_sftp($connection);
295 $dh = @opendir($curpwd);
298 return new BaseObject(-1,
'msg_ftp_invalid_path');
301 while(($file = readdir($dh)) !== FALSE)
303 if(is_dir($curpwd . $file))
314 $this->
add(
'list', $list);
326 require_once(
_XE_PATH_ .
'libs/ftp.class.php');
329 if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
331 return new BaseObject(-1,
'msg_ftp_invalid_auth_info');
334 $this->pwd = $ftp_info->ftp_root_path;
336 if(!$ftp_info->ftp_host)
338 $ftp_info->ftp_host =
"127.0.0.1";
341 if(!$ftp_info->ftp_port || !is_numeric($ftp_info->ftp_port))
343 $ftp_info->ftp_port =
"21";
346 if($ftp_info->sftp ==
'Y')
348 if(!function_exists(
'ssh2_sftp'))
350 return new BaseObject(-1,
'disable_sftp_support');
356 if($oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port))
358 if($oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password))
360 $_list = $oFtp->ftp_rawlist($this->pwd);
365 return new BaseObject(-1,
'msg_ftp_invalid_auth_info');
372 foreach($_list as $k => $v)
374 $src =
new stdClass();
378 if(strpos($v,
'd') === 0 || strpos($v,
'<DIR>'))
380 $list[] = substr(strrchr($v,
' '), 1) .
'/';
386 return new BaseObject(-1,
'msg_ftp_no_directory');
388 $this->
add(
'list', $list);
399 'ext' => array(
'pcre',
'json',
'hash',
'dom',
'session',
'spl',
'standard',
'date',
'ctype',
'tokenizer',
'apache2handler',
'filter',
'posix',
'reflection',
'pdo')
400 ,
'module' => array(
'addon',
'admin',
'autoinstall',
'comment',
'communication',
'counter',
'document',
'editor',
'file',
'importer',
'install',
'integration_search',
'layout',
'member',
'menu',
'message',
'module',
'opage',
'page',
'point',
'poll',
'rss',
'session',
'spamfilter',
'tag',
'trackback',
'trash',
'widget')
401 ,
'addon' => array(
'autolink',
'blogapi',
'captcha',
'counter',
'member_communication',
'member_extra_info',
'mobile',
'openid_delegation_id',
'point_level_icon',
'resize_image')
402 ,
'layout' => array(
'default')
403 ,
'widget' => array(
'content',
'language_select',
'login_info',
'mcontent')
404 ,
'widgetstyle' => array(),
409 $info[
'type'] = ($type !=
'INSTALL' ?
'WORKING' :
'INSTALL');
412 $info[
'host'] = $db_type->default_url ? $db_type->default_url :
getFullUrl();
413 $info[
'app'] = $_SERVER[
'SERVER_SOFTWARE'];
415 $info[
'php'] = phpversion();
418 $info[
'use_rewrite'] = $db_info->use_rewrite;
419 $info[
'use_db_session'] = $db_info->use_db_session ==
'Y' ?
'Y' :
'N';
420 $info[
'use_ssl'] = $db_info->use_ssl;
422 $info[
'phpext'] =
'';
423 foreach(get_loaded_extensions() as $ext)
425 $ext = strtolower($ext);
426 if(in_array($ext, $skip[
'ext']))
430 $info[
'phpext'] .=
'|' . $ext;
432 $info[
'phpext'] = substr($info[
'phpext'], 1);
434 $info[
'module'] =
'';
437 if($module_list)
foreach($module_list as
$module)
439 if(in_array($module->module, $skip[
'module']))
443 $info[
'module'] .=
'|' . $module->module;
445 $info[
'module'] = substr($info[
'module'], 1);
449 $addon_list = $oAddonAdminModel->getAddonList();
450 if($addon_list)
foreach($addon_list as $addon)
452 if(in_array($addon->addon, $skip[
'addon']))
456 $info[
'addon'] .=
'|' . $addon->addon;
458 $info[
'addon'] = substr($info[
'addon'], 1);
460 $info[
'layout'] =
"";
462 $layout_list = $oLayoutModel->getDownloadedLayoutList();
463 if($layout_list)
foreach($layout_list as $layout)
465 if(in_array($layout->layout, $skip[
'layout']))
469 $info[
'layout'] .=
'|' . $layout->layout;
471 $info[
'layout'] = substr($info[
'layout'], 1);
473 $info[
'widget'] =
"";
475 $widget_list = $oWidgetModel->getDownloadedWidgetList();
476 if($widget_list)
foreach($widget_list as $widget)
478 if(in_array($widget->widget, $skip[
'widget']))
482 $info[
'widget'] .=
'|' . $widget->widget;
484 $info[
'widget'] = substr($info[
'widget'], 1);
486 $info[
'widgetstyle'] =
"";
488 $widgetstyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
489 if($widgetstyle_list)
foreach($widgetstyle_list as $widgetstyle)
491 if(in_array($widgetstyle->widgetStyle, $skip[
'widgetstyle']))
495 $info[
'widgetstyle'] .=
'|' . $widgetstyle->widgetStyle;
497 $info[
'widgetstyle'] = substr($info[
'widgetstyle'], 1);
500 foreach($info as $k => $v)
504 $param .= sprintf(
'&%s=%s', $k, urlencode($v));
507 $param = substr($param, 1);
521 $theme_info = array();
524 foreach($list as $val)
541 if(
$GLOBALS[
'__ThemeInfo__'][$theme_name])
543 return $GLOBALS[
'__ThemeInfo__'][$theme_name];
546 $info_file =
_XE_PATH_ .
'themes/' . $theme_name .
'/conf/info.xml';
547 if(!file_exists($info_file))
553 $_xml_obj = $oXmlParser->loadXmlFile($info_file);
554 if(!$_xml_obj->theme)
559 $xml_obj = $_xml_obj->theme;
562 $theme_info =
new stdClass();
563 $theme_info->name = $theme_name;
564 $theme_info->title = $xml_obj->title->body;
565 $thumbnail =
'./themes/' . $theme_name .
'/thumbnail.png';
567 $theme_info->version = $xml_obj->version->body;
568 $date_obj =
new stdClass();
569 sscanf($xml_obj->date->body,
'%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
570 $theme_info->date = sprintf(
'%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
571 $theme_info->description = $xml_obj->description->body;
572 $theme_info->path =
'./themes/' . $theme_name .
'/';
574 if(!is_array($xml_obj->publisher))
576 $publisher_list = array();
577 $publisher_list[] = $xml_obj->publisher;
581 $publisher_list = $xml_obj->publisher;
584 $theme_info->publisher = array();
585 foreach($publisher_list as $publisher)
587 $publisher_obj =
new stdClass();
588 $publisher_obj->name = $publisher->name->body;
589 $publisher_obj->email_address = $publisher->attrs->email_address;
590 $publisher_obj->homepage = $publisher->attrs->link;
591 $theme_info->publisher[] = $publisher_obj;
594 $layout = $xml_obj->layout;
597 $layout_info =
new stdClass();
598 switch($layout_parse[1])
601 $layout_info->name = $theme_name .
'|@|' . $layout_parse[count($layout_parse) - 1];
605 $layout_info->name = $layout_parse[count($layout_parse) - 1];
609 $layout_info->title = $layout_parse[count($layout_parse) - 1];
614 $is_new_layout = TRUE;
616 $layout_info_list = array();
617 $layout_list = $oLayoutModel->getLayoutList($site_info->site_srl);
620 foreach($layout_list as $val)
622 if($val->layout == $layout_info->name)
624 $is_new_layout = FALSE;
625 $layout_info->layout_srl = $val->layout_srl;
634 $args =
new stdClass();
635 $args->site_srl = (int) $site_module_info->site_srl;
637 $args->layout = $layout_info->name;
638 $args->title = $layout_info->title;
639 $args->layout_type =
"P";
643 $layout_info->layout_srl =
$args->layout_srl;
646 $theme_info->layout_info = $layout_info;
648 $skin_infos = $xml_obj->skininfos;
649 if(is_array($skin_infos->skininfo))
651 $skin_list = $skin_infos->skininfo;
655 $skin_list = array($skin_infos->skininfo);
660 foreach($skin_list as $val)
662 $skin_info =
new stdClass();
664 $skin_parse = explode(
'/', $val->directory->attrs->path);
665 switch($skin_parse[1])
669 $module_name = $skin_parse[count($skin_parse) - 1];
670 $skin_info->name = $theme_name .
'|@|' . $module_name;
675 $module_name = $skin_parse[2];
676 $skin_info->name = $skin_parse[count($skin_parse) - 1];
680 $skin_info->path = $val->directory->attrs->path;
681 $skin_info->is_theme = $is_theme;
682 $skins[$module_name] = $skin_info;
686 if(!
$GLOBALS[
'__ThemeModuleSkin__'][$module_name])
688 $GLOBALS[
'__ThemeModuleSkin__'][$module_name] = array();
689 $GLOBALS[
'__ThemeModuleSkin__'][$module_name][
'skins'] = array();
693 $GLOBALS[
'__ThemeModuleSkin__'][$module_name][
'skins'][$skin_info->name] =
$oModuleModel->loadSkinInfo($skin_info->path,
'',
'');
696 $theme_info->skin_infos = $skins;
698 $GLOBALS[
'__ThemeInfo__'][$theme_name] = $theme_info;
708 if(
$GLOBALS[
'__ThemeModuleSkin__'][
'__IS_PARSE__'])
710 return $GLOBALS[
'__ThemeModuleSkin__'];
713 sort($searched_list);
715 $searched_count = count($searched_list);
721 $exceptionModule = array(
'editor',
'poll',
'homepage',
'textyle');
724 foreach($searched_list as $val)
728 if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
730 if(!
$GLOBALS[
'__ThemeModuleSkin__'][$val])
732 $GLOBALS[
'__ThemeModuleSkin__'][$val] = array();
735 $GLOBALS[
'__ThemeModuleSkin__'][$val][
'skins'] = array();
737 $GLOBALS[
'__ThemeModuleSkin__'][$val][
'skins'] = array_merge(
$GLOBALS[
'__ThemeModuleSkin__'][$val][
'skins'], $skin_list);
740 $GLOBALS[
'__ThemeModuleSkin__'][
'__IS_PARSE__'] = TRUE;
742 return $GLOBALS[
'__ThemeModuleSkin__'];
751 static $lang =
false;
754 if(
$lang ===
false && $oCacheHandler->isSupport())
757 $lang = $oCacheHandler->get($cache_key);
765 foreach($installed_module_list as $key => $value)
767 $moduleActionInfo =
$oModuleModel->getModuleActionXml($value->module);
768 if(is_object($moduleActionInfo->menu))
770 foreach($moduleActionInfo->menu as $key2 => $value2)
772 $lang[$key2] = $value2->title;
777 $oCacheHandler->put($cache_key,
$lang);
792 $args =
new stdClass();
793 $args->site_srl = $siteSrl;
804 if($isGetModuleInfo && is_array(
$output->data))
807 foreach(
$output->data AS $key => $value)
816 $returnObject->add(
'favoriteList',
$output->data);
817 return $returnObject;
828 $args =
new stdClass();
829 $args->site_srl = $siteSrl;
840 $returnObject->add(
'result', TRUE);
841 $returnObject->add(
'favoriteSrl',
$output->data->admin_favorite_srl);
845 $returnObject->add(
'result', FALSE);
848 return $returnObject;
862 $this->
add(
'site_list', $siteList);
873 $args =
new stdClass();
876 $args->domain = $domain;
878 $columnList = array(
'domain',
'site_srl');
888 foreach($siteList as $key => $value)
890 $args->site_srl = $value->site_srl;
895 $list = array($list);
898 foreach($list as $k => $v)
900 if(!is_dir(
_XE_PATH_ .
'modules/' . $v->module))
908 unset($siteList[$key]);
921 $args =
new stdClass();
925 $args->regDate = date(
'Ymd', strtotime($date));
939 return $this->
iconUrlCheck(
'favicon.ico',
'faviconSample.png', $default);
944 return $this->
iconUrlCheck(
'mobicon.png',
'mobiconSample.png', $default);
951 if($site_info->site_srl)
953 $virtual_site = $site_info->site_srl .
'/';
957 if(!$file_exsit && $default ===
true)
959 $icon_url =
'./modules/admin/tpl/img/' . $default_icon_name;
963 $default_url = Context::GetUrl();
964 if($default_url && substr_compare($default_url,
'/', -1) === 0) $default_url = substr($default_url, 0, -1);
965 $icon_url = $default_url .
'/files/attach/xeicon/' . $virtual_site . $iconname;
getFavoriteList($siteSrl=0, $isGetModuleInfo=FALSE)
getSiteCountByDate($date= '')
if(file_exists(_XE_PATH_. 'config/config.user.inc.php')) if(!defined('__DEBUG__')) if(!defined('__DEBUG_OUTPUT__')) if(!defined('__DEBUG_PROTECT__')) if(!defined('__DEBUG_PROTECT_IP__')) if(!defined('__DEBUG_DB_OUTPUT__')) if(!defined('__LOG_SLOW_QUERY__')) if(!defined('__LOG_SLOW_TRIGGER__')) if(!defined('__LOG_SLOW_ADDON__')) if(!defined('__LOG_SLOW_WIDGET__')) if(!defined('__DEBUG_QUERY__')) if(!defined('__OB_GZHANDLER_ENABLE__')) if(!defined('__ENABLE_PHPUNIT_TEST__')) if(!defined('__PROXY_SERVER__')) if(!defined('__ERROR_LOG__')) if(!defined('__DISABLE_DEFAULT_CSS__')) if(!defined('__AUTO_OPCACHE_INVALIDATE__')) if((__DEBUG_OUTPUT__==2)&&version_compare(PHP_VERSION, '6.0.0')===-1) if(version_compare(PHP_VERSION, '5.3.0') >=0) $GLOBALS['__xe_autoload_file_map']
& getInstance($target= 'object', $info=null, $always_use_file=false)
writeFile($filename, $buff, $mode="w")
getThemeInfo($theme_name, $layout_list=NULL)
getRemoteResource($url, $body=null, $timeout=3, $method= 'GET', $content_type=null, $headers=array(), $cookies=array(), $post_data=array(), $request_config=array())
iconUrlCheck($iconname, $default_icon_name, $default)
$layout_path
a path of directory where layout files reside
isExistsFavorite($siteSrl, $module)
getAdminModel($module_name)
getFaviconUrl($default=true)
getMobileIconUrl($default=true)
convertEncoding($source_obj)
executeQueryArray($query_id, $args=NULL, $arg_columns=NULL)
getAdminController($module_name)
readDir($path, $filter= '', $to_lower=FALSE, $concat_prefix=FALSE)
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
$module
Class name of Xe Module that is identified by mid.
getAllSitesThatHaveModules($domain=NULL)
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang