diff --git a/htdocs/core/filemanagerdol/connectors/php/config.php b/htdocs/core/filemanagerdol/connectors/php/config.php index 7b5bea4e97be5b2ad2761484a0539d746d5db225..8733e6a7c1706dfc086c8f1a7d89fd431724fa7e 100644 --- a/htdocs/core/filemanagerdol/connectors/php/config.php +++ b/htdocs/core/filemanagerdol/connectors/php/config.php @@ -67,7 +67,7 @@ $Config['SecureImageUploads'] = true; $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder'); // Allowed Resource Types. -$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media'); +$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Media'); // For security, HTML is allowed in the first Kb of data for files having the // following extensions only. @@ -78,11 +78,19 @@ $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js"); // If possible, it is recommended to set more restrictive permissions, like 0755. // Set to 0 to disable this feature. // Note: not needed on Windows-based servers. -$Config['ChmodOnUpload'] = 0775 ; +$newmask = '0644'; +if (! empty($conf->global->MAIN_UMASK)) $newmask=$conf->global->MAIN_UMASK; +$Config['ChmodOnUpload'] = $newmask; // See comments above. // Used when creating folders that does not exist. -$Config['ChmodOnFolderCreate'] = 0775 ; +$newmask = '0755'; +$dirmaskdec=octdec($newmask); +if (! empty($conf->global->MAIN_UMASK)) $dirmaskdec=octdec($conf->global->MAIN_UMASK); +$dirmaskdec |= octdec('0200'); // Set w bit required to be able to create content for recursive subdirs files +$newmask = decoct($dirmaskdec); + +$Config['ChmodOnFolderCreate'] = $newmask; /* Configuration settings for each Resource Type diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 3a09f226eb0a5f724accfd5105751378282b8398..a0b2106ac63a70a9b2b6d670f2bdca5d03cdbe5a 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -16,4 +16,5 @@ Website=Web site AddPage=Add page Page=Page PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page. -PageDeleted=Page %s of website %s deleted \ No newline at end of file +PageDeleted=Page %s of website %s deleted +ViewInNewTab=View in new tab \ No newline at end of file diff --git a/htdocs/public/websites/index.php b/htdocs/public/websites/index.php index aa7d5d4941de864d53611c504f0c03fbba570430..b54a69e90f9e40b16d5eca43d685f043ecf160d7 100644 --- a/htdocs/public/websites/index.php +++ b/htdocs/public/websites/index.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2016 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 @@ -16,7 +16,7 @@ */ /** - * \file htdocs/public/paypal/index.php + * \file htdocs/public/websites/index.php * \ingroup core * \brief A redirect page to an error * \author Laurent Destailleur @@ -64,6 +64,24 @@ if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_AP //print 'Directory with '.$appli.' websites.<br>'; +if (empty($pageid)) +{ + require_once DOL_DOCUMENT_ROOT.'/websites/class/website.class.php'; + require_once DOL_DOCUMENT_ROOT.'/websites/class/websitepage.class.php'; + + $object=new Website($db); + $object->fetch(0, $website); + + $objectpage=new WebsitePage($db); + $array=$objectpage->fetchAll($object->id); + + if (count($array) > 0) + { + $firstrep=reset($array); + $pageid=$firstrep->id; + } +} + // Security: Delete string ../ into $original_file global $dolibarr_main_data_root; diff --git a/htdocs/websites/class/websitepage.class.php b/htdocs/websites/class/websitepage.class.php index 430cf4f0f3b6533a778b52659201132ceeb350fc..b363687765f3252ac4de5f9dd28785fba88c509b 100644 --- a/htdocs/websites/class/websitepage.class.php +++ b/htdocs/websites/class/websitepage.class.php @@ -307,7 +307,7 @@ class WebsitePage extends CommonObject while ($obj = $this->db->fetch_object($resql)) { - $record = new Websitepage($this->db); + $record = new WebsitePage($this->db); $record->id = $obj->rowid; $record->fk_website = $obj->fk_website; @@ -320,7 +320,7 @@ class WebsitePage extends CommonObject $record->date_creation = $this->db->jdate($obj->date_creation); $record->date_modification = $this->db->jdate($obj->date_modification); $record->tms = $this->db->jdate($obj->tms); - + //var_dump($record->id); $records[$record->id] = $record; } $this->db->free($resql); diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index 91c4921d29d979f49d2a78ef39b6f5c4ec2bcd90..98efd23f45b27f9df04a8f32f67ebf8a0a82fd73 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -420,6 +420,7 @@ if (count($object->records) > 0) print $langs->trans("Website").': '; print '</div>'; + // List of websites print '<div class="websiteselection">'; $out=''; $out.='<select name="website">'; @@ -441,8 +442,13 @@ if (count($object->records) > 0) print $out; print '<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">'; + if ($website) + { + print '<a href="'.DOL_URL_ROOT.'/public/websites/index.php?website='.$website.'" target="tab'.$website.'">'.$langs->trans("ViewInNewTab").'</a>'; + } print '</div>'; + // Button for websites print '<div class="websitetools">'; if ($action == 'preview')