mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
API Remove references to non-existent installation tool (#2961)
This commit is contained in:
parent
ca77540101
commit
c2191622a6
@ -13,21 +13,17 @@ use SilverStripe\Control\Middleware\HTTPCacheControlMiddleware;
|
|||||||
use SilverStripe\Core\Convert;
|
use SilverStripe\Core\Convert;
|
||||||
use SilverStripe\Core\Injector\Injector;
|
use SilverStripe\Core\Injector\Injector;
|
||||||
use SilverStripe\Core\Manifest\ModuleManifest;
|
use SilverStripe\Core\Manifest\ModuleManifest;
|
||||||
use SilverStripe\Dev\Deprecation;
|
|
||||||
use SilverStripe\i18n\i18n;
|
use SilverStripe\i18n\i18n;
|
||||||
use SilverStripe\ORM\ArrayList;
|
use SilverStripe\ORM\ArrayList;
|
||||||
use SilverStripe\ORM\DataObject;
|
use SilverStripe\ORM\DataObject;
|
||||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||||
use SilverStripe\ORM\FieldType\DBField;
|
use SilverStripe\ORM\FieldType\DBField;
|
||||||
use SilverStripe\ORM\FieldType\DBHTMLText;
|
|
||||||
use SilverStripe\ORM\FieldType\DBVarchar;
|
|
||||||
use SilverStripe\ORM\SS_List;
|
use SilverStripe\ORM\SS_List;
|
||||||
use SilverStripe\Security\MemberAuthenticator\MemberAuthenticator;
|
use SilverStripe\Security\MemberAuthenticator\MemberAuthenticator;
|
||||||
use SilverStripe\Security\Permission;
|
use SilverStripe\Security\Permission;
|
||||||
use SilverStripe\Security\Security;
|
use SilverStripe\Security\Security;
|
||||||
use SilverStripe\SiteConfig\SiteConfig;
|
use SilverStripe\SiteConfig\SiteConfig;
|
||||||
use SilverStripe\Versioned\Versioned;
|
use SilverStripe\Versioned\Versioned;
|
||||||
use SilverStripe\View\ArrayData;
|
|
||||||
use SilverStripe\View\Parsers\URLSegmentFilter;
|
use SilverStripe\View\Parsers\URLSegmentFilter;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
use SilverStripe\View\SSViewer;
|
use SilverStripe\View\SSViewer;
|
||||||
@ -60,8 +56,6 @@ class ContentController extends Controller
|
|||||||
];
|
];
|
||||||
|
|
||||||
private static $allowed_actions = [
|
private static $allowed_actions = [
|
||||||
'successfullyinstalled',
|
|
||||||
'deleteinstallfiles', // secured through custom code
|
|
||||||
'LoginForm',
|
'LoginForm',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -438,87 +432,4 @@ HTML;
|
|||||||
$templates = array_merge(...$templatesFound);
|
$templates = array_merge(...$templatesFound);
|
||||||
return SSViewer::create($templates);
|
return SSViewer::create($templates);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This action is called by the installation system
|
|
||||||
*
|
|
||||||
* @deprecated 5.3.0 Will be removed without equivalent functionality
|
|
||||||
*/
|
|
||||||
public function successfullyinstalled()
|
|
||||||
{
|
|
||||||
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality');
|
|
||||||
// Return 410 Gone if this site is not actually a fresh installation
|
|
||||||
if (!file_exists(PUBLIC_PATH . '/install.php')) {
|
|
||||||
$this->httpError(410);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_SESSION['StatsID']) && $_SESSION['StatsID']) {
|
|
||||||
$url = 'http://ss2stat.silverstripe.com/Installation/installed?ID=' . $_SESSION['StatsID'];
|
|
||||||
@file_get_contents($url ?? '');
|
|
||||||
}
|
|
||||||
|
|
||||||
global $project;
|
|
||||||
$data = new ArrayData([
|
|
||||||
'Project' => Convert::raw2xml($project),
|
|
||||||
'Username' => Convert::raw2xml($this->getRequest()->getSession()->get('username')),
|
|
||||||
'Password' => Convert::raw2xml($this->getRequest()->getSession()->get('password')),
|
|
||||||
]);
|
|
||||||
|
|
||||||
return [
|
|
||||||
"Title" => _t(__CLASS__ . ".INSTALL_SUCCESS", "Installation Successful!"),
|
|
||||||
"Content" => $data->renderWith([
|
|
||||||
'type' => 'Includes',
|
|
||||||
'Install_successfullyinstalled',
|
|
||||||
]),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 5.3.0 Will be removed without equivalent functionality
|
|
||||||
*/
|
|
||||||
public function deleteinstallfiles()
|
|
||||||
{
|
|
||||||
Deprecation::notice('5.3.0', 'Will be removed without equivalent functionality');
|
|
||||||
if (!Permission::check("ADMIN")) {
|
|
||||||
return Security::permissionFailure($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = new DBVarchar("Title");
|
|
||||||
$content = new DBHTMLText('Content');
|
|
||||||
|
|
||||||
// As of SS4, index.php is required and should never be deleted.
|
|
||||||
$installfiles = [
|
|
||||||
'install.php',
|
|
||||||
'install-frameworkmissing.html',
|
|
||||||
'index.html'
|
|
||||||
];
|
|
||||||
|
|
||||||
$unsuccessful = new ArrayList();
|
|
||||||
foreach ($installfiles as $installfile) {
|
|
||||||
$installfilepath = PUBLIC_PATH . '/' . $installfile;
|
|
||||||
if (file_exists($installfilepath ?? '')) {
|
|
||||||
@unlink($installfilepath ?? '');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (file_exists($installfilepath ?? '')) {
|
|
||||||
$unsuccessful->push(new ArrayData(['File' => $installfile]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$data = new ArrayData([
|
|
||||||
'Username' => Convert::raw2xml($this->getRequest()->getSession()->get('username')),
|
|
||||||
'Password' => Convert::raw2xml($this->getRequest()->getSession()->get('password')),
|
|
||||||
'UnsuccessfulFiles' => $unsuccessful,
|
|
||||||
]);
|
|
||||||
$content->setValue($data->renderWith([
|
|
||||||
'type' => 'Includes',
|
|
||||||
'Install_deleteinstallfiles',
|
|
||||||
]));
|
|
||||||
|
|
||||||
return [
|
|
||||||
"Title" => $title,
|
|
||||||
"Content" => $content,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2212,17 +2212,6 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(PUBLIC_PATH . '/install.php')) {
|
|
||||||
$fields->addFieldToTab('Root.Main', LiteralField::create(
|
|
||||||
'InstallWarningHeader',
|
|
||||||
'<div class="alert alert-warning">' . _t(
|
|
||||||
__CLASS__ . '.REMOVE_INSTALL_WARNING',
|
|
||||||
"Warning: You should remove install.php from this SilverStripe install for security reasons."
|
|
||||||
)
|
|
||||||
. '</div>'
|
|
||||||
), 'Title');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (self::$runCMSFieldsExtensions) {
|
if (self::$runCMSFieldsExtensions) {
|
||||||
$this->extend('updateCMSFields', $fields);
|
$this->extend('updateCMSFields', $fields);
|
||||||
}
|
}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<% if $UnsuccessfulFiles %>
|
|
||||||
<p style=\"margin: 1em 0\">
|
|
||||||
<%t SilverStripe\CMS\Controllers\ContentController.UnableDeleteInstall "Unable to delete installation files. Please delete the files below manually" %>:
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<% loop $UnsuccessfulFiles %>
|
|
||||||
<li>$File</li>
|
|
||||||
<% end_loop %>
|
|
||||||
</ul>
|
|
||||||
<% else %>
|
|
||||||
<p style="margin: 1em 0">
|
|
||||||
<%t SilverStripe\CMS\Controllers\ContentController.InstallFilesDeleted "Installation files have been successfully deleted." %>
|
|
||||||
</p>
|
|
||||||
<p style="margin: 1em 0">
|
|
||||||
<%t SilverStripe\CMS\Controllers\ContentController.StartEditing 'You can start editing your content by opening <a href="{link}">the CMS</a>.' link="admin/" %>
|
|
||||||
<br />
|
|
||||||
<%t SilverStripe\CMS\Controllers\ContentController.Email "Email" %>: $Username<br />
|
|
||||||
<%t SilverStripe\CMS\Controllers\ContentController.Password "Password" %>: $Password<br />
|
|
||||||
</p>
|
|
||||||
<% end_if %>
|
|
@ -1,21 +0,0 @@
|
|||||||
<p>
|
|
||||||
<%t SilverStripe\\CMS\\Controllers\\ContentController.InstallSuccessCongratulations "SilverStripe has been successfully installed!" %>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<% if $Project == 'tutorial' %>
|
|
||||||
<%t SilverStripe\\CMS\\Controllers\\ContentController.PostInstallTutorialIntro 'This website is a simplistic version of a SilverStripe 3 site. To extend this, please take a look at {link}.' link='<a href="http://doc.silverstripe.org/framework/en/tutorials">our tutorials</a>' %>
|
|
||||||
<% end_if %>
|
|
||||||
|
|
||||||
<p><strong> <%t SilverStripe\\CMS\\Controllers\\ContentController.Email "Email" %>: $Username</strong></br>
|
|
||||||
<strong> <%t SilverStripe\\CMS\\Controllers\\ContentController.Password "Password" %>: $Password</strong></p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<%t SilverStripe\\CMS\\Controllers\\ContentController.StartEditing 'You can start editing your content by opening <a href="{link}">the CMS</a>.' link="admin/" %>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div style="background:#fcf8f2; border-radius:4px; border: 1px solid #ffc28b; padding:5px; margin:5px;">
|
|
||||||
<img src="$resourceURL('silverstripe/cms:client/dist/images/alert.gif')" style="border: none; margin-right: 10px; float: left; height:48px; width:48px" />
|
|
||||||
<p style="color: #cb6a1c; margin-bottom:0;">
|
|
||||||
<%t SilverStripe\\CMS\\Controllers\\ContentController.InstallSecurityWarning 'For security reasons you should now delete the install files, unless you are planning to reinstall later (<em>requires admin login, see above</em>). The web server also now only needs write access to the "assets" folder, you can remove write access from all other folders. <a href="{link}" style="text-align: center;">Click here to delete the install files.</a>' link="home/deleteinstallfiles" %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
Loading…
Reference in New Issue
Block a user