23 if(!$module_name)
return new BaseObject(-1,
'invalid_request');
26 $oInstallController->installModule($module_name,
'./modules/'.$module_name);
38 if(!$module_name)
return new BaseObject(-1,
'invalid_request');
40 $oModule =
getModule($module_name,
'class');
41 if($oModule)
$output = $oModule->moduleUpdate();
58 $admin_ip_list = preg_replace(
"/[\r|\n|\r\n]+/",
",",$admin_ip_list);
59 $admin_ip_list = preg_replace(
"/\s+/",
"",$admin_ip_list);
60 if(preg_match(
'/(<\?|<\?php|\?>)/xsm', $admin_ip_list))
64 $admin_ip_list .=
',127.0.0.1,' . $_SERVER[
'REMOTE_ADDR'];
65 $admin_ip_list = explode(
',',trim($admin_ip_list,
','));
66 $admin_ip_list = array_unique($admin_ip_list);
73 if($default_url && strncasecmp(
'http://', $default_url, 7) !== 0 && strncasecmp(
'https://', $default_url, 8) !== 0) $default_url =
'http://'.$default_url;
74 if($default_url && substr($default_url, -1) !==
'/') $default_url = $default_url.
'/';
77 require_once(
_XE_PATH_ .
'libs/idna_convert/idna_convert.class.php');
79 $default_url =
$IDN->encode($default_url);
82 if(!$use_ssl) $use_ssl =
'none';
88 if($use_rewrite!=
'Y') $use_rewrite =
'N';
91 if($use_sso !=
'Y') $use_sso =
'N';
94 if($use_db_session!=
'Y') $use_db_session =
'N';
96 $qmail_compatibility =
Context::get(
'qmail_compatibility');
97 if($qmail_compatibility!=
'Y') $qmail_compatibility =
'N';
100 if(!$use_html5) $use_html5 =
'N';
102 $db_info->default_url = $default_url;
103 $db_info->qmail_compatibility = $qmail_compatibility;
104 $db_info->use_db_session = $use_db_session;
105 $db_info->use_rewrite = $use_rewrite;
106 $db_info->use_sso = $use_sso;
107 $db_info->use_ssl = $use_ssl;
108 $db_info->use_html5 = $use_html5;
109 $db_info->admin_ip_list = $admin_ip_list;
111 if($http_port) $db_info->http_port = (int) $http_port;
112 else if($db_info->http_port) unset($db_info->http_port);
114 if($https_port) $db_info->https_port = (int) $https_port;
115 else if($db_info->https_port) unset($db_info->https_port);
117 unset($db_info->lang_type);
120 if(!$oInstallController->makeConfigFile())
122 return new BaseObject(-1,
'msg_invalid_request');
143 return new BaseObject(-1,
'msg_invalid_request');
155 $output = $oMenuAdminModel->getMenuItemInfo($menuItemSrl);
160 if(file_exists($homeMenuCacheFile))
162 include($homeMenuCacheFile);
165 if(!$homeMenuSrl || $homeMenuSrl !=
$output->menu_srl)
176 if(file_exists($ftp_config_file)) unlink($ftp_config_file);
177 if($_SESSION[
'ftp_password']) unset($_SESSION[
'ftp_password']);
188 if(!$ftp_info->ftp_pasv) $ftp_info->ftp_pasv =
"N";
192 if(substr($ftp_root_path, strlen($ftp_root_path)-1) ==
"/")
194 $ftp_info->ftp_root_path = $ftp_root_path;
198 $ftp_info->ftp_root_path = $ftp_root_path.
'/';
201 if(ini_get(
'safe_mode'))
206 $buff =
'<?php if(!defined("__XE__")) exit();'.
"\n\$ftp_info = new stdClass;\n";
207 foreach($ftp_info as $key => $val)
210 if(preg_match(
'/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|file_get_contents|file_put_contents|exec|proc_open|popen|passthru|show_source|phpinfo|system|\/\*|\*\/|chr\()/xsm', preg_replace(
'/\s/',
'', $val)))
214 $buff .= sprintf(
"\$ftp_info->%s = '%s';\n", $key, str_replace(
"'",
"\\'",$val));
218 FileHandler::WriteFile($config_file, $buff);
219 if($_SESSION[
'ftp_password']) unset($_SESSION[
'ftp_password']);
229 if($use_mobile_view!=
'Y') $use_mobile_view =
'N';
234 $db_info->use_mobile_view = $use_mobile_view;
237 unset($db_info->lang_type);
240 if(!$oInstallController->makeConfigFile())
242 return new BaseObject(-1,
'msg_invalid_request');
260 $this->updateIcon(
'favicon.ico',$deleteFavicon);
261 $this->updateIcon(
'mobicon.png',$deleteMobicon);
264 $config =
new stdClass();
265 $config->thumbnail_type =
Context::get(
'thumbnail_type');
279 if(!$favicon && !$mobicon) {
285 $tmpFileName = $this->saveIconTmp($favicon,
'favicon.ico');
288 $tmpFileName = $this->saveIconTmp($mobicon,
'mobicon.png');
292 Context::set(
'tmpFileName', $tmpFileName.
'?'.$_SERVER[
'REQUEST_TIME']);
300 $langs = $selected_lang;
304 for($i=0;$i<count($langs);$i++)
306 $buff .= sprintf(
"%s,%s\n", $langs[$i], $lang_supported[$langs[$i]]);
320 $documentConfig =
getModel(
'document')->getDocumentConfig();
322 if (!$config->thumbnail_type || $config->thumbnail_type !=
'ratio')
324 $documentConfig->thumbnail_type =
'crop';
328 $documentConfig->thumbnail_type =
'ratio';
334 $args =
new stdClass;
335 $args->htmlFooter = $config->htmlFooter;
336 $args->siteTitle = $config->siteTitle;
340 private function saveIconTmp($icon, $iconname)
345 if($site_info->site_srl)
347 $virtual_site = $site_info->site_srl .
'/';
350 $target_file = $icon[
'tmp_name'];
351 $type = $icon[
'type'];
352 $relative_filename =
'files/attach/xeicon/'.$virtual_site.
'tmp/'.$iconname;
353 $target_filename =
_XE_PATH_.$relative_filename;
355 list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
356 if($iconname ==
'favicon.ico')
358 if(!preg_match(
'/^.*(x-icon|\.icon)$/i',$type)) {
363 else if($iconname ==
'mobicon.png')
365 if(!preg_match(
'/^.*(png).*$/',$type)) {
369 if(!(($height ==
'57' && $width ==
'57') || ($height ==
'114' && $width ==
'114'))) {
380 $fitHeight = $fitWidth = $height;
383 return $relative_filename;
386 private function updateIcon($iconname, $deleteIcon =
false) {
390 if($site_info->site_srl)
392 $virtual_site = $site_info->site_srl .
'/';
395 $image_filepath =
_XE_PATH_.
'files/attach/xeicon/' . $virtual_site;
402 $tmpicon_filepath = $image_filepath.
'tmp/'.$iconname;
403 $icon_filepath = $image_filepath.$iconname;
404 if(file_exists($tmpicon_filepath))
setTemplateFile($filename)
setMessage($message= 'success', $type=NULL)
getController($module_name)
procInstallAdminRemoveFTPInfo()
validate($ip_list=array())
set($key, $val, $set_to_get_vars=0)
writeFile($filename, $buff, $mode="w")
procInstallAdminSaveFTPInfo()
moveFile($source, $target)
procInstallAdminUpdateIndexModule()
setRedirectUrl($url= './', $output=NULL)
procInstallAdminSaveTimeZone()
Change settings.
setModulesConfig($config)
getAdminModel($module_name)
install module of the high class
saveLangSelected($selected_lang)
Supported languages (was procInstallAdminSaveLangSelected)
procInstallAdminInstall()
Install the module.
copyFile($source, $target, $force= 'Y')
procInstallAdminConfigIconUpload()
admin controller class of the install module
getAdminController($module_name)
getModule($module_name, $type= 'view', $kind= '')
procInstallAdminUpdate()
Upate the module.