Commit 0a866a9e authored by Stefan Busemann's avatar Stefan Busemann
Browse files

Merge branch 'develop' into '88-reactivate-user-process'

# Conflicts:
#   html/typo3conf/ext/t3omy/ext_localconf.php
parents 88833644 b08f3041
Pipeline #4901 failed with stages
in 12 seconds
......@@ -14,5 +14,5 @@ hooks:
- exec: composer install -d /var/www/html
- exec: npm --prefix typo3conf/ext/t3olayout/Build install
- exec: npm --prefix typo3conf/ext/t3olayout/Build run-script build
- exec: ../bin/typo3cms install:generatepackagestates
- exec: ../bin/typo3cms install:extensionsetupifpossible
- exec: ../vendor/bin/typo3cms install:generatepackagestates
- exec: ../vendor/bin/typo3cms install:extensionsetupifpossible
......@@ -6,6 +6,7 @@ html/typo3
html/fileadmin/
html/typo3conf/ext/*
!html/typo3conf/ext/t3omy/
!html/typo3conf/ext/t3o_slack/
html/typo3conf/AdditionalConfiguration.php
html/typo3conf/deprecation_*
html/typo3conf/ENABLE_INSTALL_TOOL
......
......@@ -7,10 +7,21 @@ before_script:
stages:
- dump
- test
- build
- layout
- deploy
test:php:
stage: test
image: ekreative/php-cs-fixer:2
variables:
GIT_STRATEGY: "clone"
script:
- php-cs-fixer fix --dry-run --config=.gitlab-ci/build/.php_cs --diff
except:
- assets
build:
stage: build
image: php:7.0-alpine
......
<?php
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ php-cs-fixer fix --config ../Build/.php_cs
*
* inside the TYPO3 directory. Warning: This may take up to 10 minutes.
*
* For more information read:
* https://www.php-fig.org/psr/psr-2/
* https://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
// Define in which folders to search and which folders to exclude
// Exclude some directories that are excluded by Git anyways to speed up the sniffing
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('typo3temp')
->in(__DIR__ . '/../../');
// Return a Code Sniffing configuration using
// all sniffers needed for PSR-2
// and additionally:
// - Remove leading slashes in use clauses.
// - PHP single-line arrays should not have trailing comma.
// - Single-line whitespace before closing semicolon are prohibited.
// - Remove unused use statements in the PHP source code
// - Ensure Concatenation to have at least one whitespace around
// - Remove trailing whitespace at the end of blank lines.
return PhpCsFixer\Config::create()->setRiskyAllowed(true)->setRules([
'@PSR2' => true,
'@DoctrineAnnotation' => true,
'no_leading_import_slash' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'concat_space' => ['spacing' => 'one'],
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'single_quote' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
'no_leading_namespace_whitespace' => true,
'native_function_casing' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_trim' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'return_type_declaration' => ['space_before' => 'none'],
'cast_spaces' => ['space' => 'none'],
'declare_equal_normalize' => ['space' => 'single'],
'dir_constant' => true,
])->setFinder($finder);
......@@ -5,7 +5,6 @@ namespace Deployer;
require_once '/composer/vendor/deployer/deployer/recipe/common.php';
require_once '/composer/vendor/deployer/recipes/rsync.php';
$sharedDirectories = [
'html/fileadmin',
'html/uploads',
......@@ -54,14 +53,15 @@ set('rsync_src', './');
set('keep_releases', 10);
serverList('./.gitlab-ci/deployer/servers.yml');
set('php', '/opt/php/php70/bin/php');
set('typo3_console', 'vendor/bin/typo3cms');
task('typo3', function () {
run('cd {{release_path}} && {{php}} bin/typo3cms install:generatepackagestates');
run('cd {{release_path}} && {{php}} bin/typo3cms install:extensionsetupifpossible');
run('cd {{release_path}} && {{php}} {{typo3_console}} install:generatepackagestates');
run('cd {{release_path}} && {{php}} {{typo3_console}} install:extensionsetupifpossible');
});
task('cache', function () {
run('cd {{release_path}} && {{php}} bin/cachetool opcache:reset');
run('cd {{release_path}} && {{php}} {{typo3_console}} opcache:reset');
});
task('deploy', [
......
......@@ -8,18 +8,10 @@
}
],
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
},
{
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/t3olayout.git"
},
{
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/t3o_slack.git"
},
{
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/t3o_ldap.git"
......@@ -28,39 +20,40 @@
"type": "vcs",
"url": "https://git-t3o.typo3.org/t3o/gitlab_api.git"
}
],
"support": {
"email": "maintenance@typo3.org",
"issues": "https://git-t3o.typo3.org/t3o/my/issues"
},
"require": {
"typo3/cms": "^8.7",
"helhum/typo3-console": "^5.0",
"dmitryd/typo3-realurl": "^2.1",
"t3o/t3o_slack": " ^1.1",
"t3o/t3olayout": "^3.0",
"t3o/t3o_ldap": "^1.0",
"typo3-ter/femanager": "^4.0",
"in2code/femanager": "^4.0",
"in2code/userprofile": "^0.2",
"sjbr/static-info-tables": "^6.5",
"t3o/gitlab_api": "^1.0",
"gordalina/cachetool": "^3.2"
},
"config": {
"bin-dir": "bin"
"platform": {
"php": "7.0.30"
}
},
"extra": {
"typo3/cms": {
"web-dir": "html",
"cms-package-dir": "{$vendor-dir}/typo3/cms"
},
"helhum/typo3-console": {
"install-binary": true,
"install-extension-dummy": false
}
},
"autoload": {
"psr-4": {
"T3o\\T3olayout\\": "html/typo3conf/ext/t3olayout/Classes",
"T3o\\T3omy\\": "html/typo3conf/ext/t3omy/Classes",
"T3o\\Userprofile\\": "html/typo3conf/ext/userprofile/Classes"
"T3o\\Userprofile\\": "html/typo3conf/ext/userprofile/Classes",
"T3o\\T3oSlack\\": "html/typo3conf/ext/t3o_slack/Classes"
}
}
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "1040f4811c092760e71fd09eec1fee55",
"content-hash": "6e2c4c42e3eca67d4850887bd19d94aa",
"packages": [
{
"name": "adoy/fastcgi-client",
......@@ -745,11 +745,11 @@
},
{
"name": "gridelementsteam/gridelements",
"version": "8.2.1",
"version": "8.2.3",
"source": {
"type": "git",
"url": "https://git.typo3.org/TYPO3CMS/Extensions/gridelements.git",
"reference": "ae8c71f8708e7fbbb96f3956b83477484642ebce"
"reference": "fc617c5e2359613afec7a881ca93fcff53a1c545"
},
"require": {
"typo3/cms-core": ">=8.7.0,<9.0"
......@@ -775,7 +775,7 @@
"TYPO3 CMS",
"grids"
],
"time": "2018-04-04T07:55:37+00:00"
"time": "2018-06-18T18:23:18+00:00"
},
{
"name": "guzzlehttp/guzzle",
......@@ -1106,6 +1106,73 @@
],
"time": "2017-12-13T13:52:52+00:00"
},
{
"name": "in2code/femanager",
"version": "4.2.2",
"source": {
"type": "git",
"url": "https://github.com/in2code-de/femanager.git",
"reference": "72131aea44570406a419ee28a317beabe59aa7ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/in2code-de/femanager/zipball/72131aea44570406a419ee28a317beabe59aa7ac",
"reference": "72131aea44570406a419ee28a317beabe59aa7ac",
"shasum": ""
},
"require": {
"typo3/cms-core": ">=8.7.0 <9.0.0"
},
"replace": {
"femanager": "self.version",
"typo3-ter/femanager": "self.version"
},
"require-dev": {
"behat/behat": "^3.4",
"behat/mink-extension": "^2.1",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.3",
"mikey179/vfsstream": "^1.4",
"nimut/testing-framework": "^1.0",
"phpunit/phpunit": "^4.7 || ^5.0",
"se/selenium-server-standalone": "^2.0",
"typo3/cms-extbase": "^8.7.10"
},
"type": "typo3-cms-extension",
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/Web"
}
},
"autoload": {
"psr-4": {
"In2code\\Femanager\\": "Classes/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Alex Kellner",
"email": "alexander.kellner@in2code.de"
}
],
"description": "Modern TYPO3 Frontend User Registration.",
"homepage": "https://github.com/in2code-de/femanager",
"keywords": [
"fe_users",
"form",
"frontend",
"profile",
"registration",
"sr_feuser_register",
"typo3"
],
"time": "2018-05-11T11:47:21+00:00"
},
{
"name": "in2code/userprofile",
"version": "0.2.1",
......@@ -2023,48 +2090,13 @@
],
"time": "2018-04-26T08:48:59+00:00"
},
{
"name": "t3o/t3o_slack",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://git-t3o.typo3.org/t3o/t3o_slack.git",
"reference": "b54173272a28229d21c0ae2df82cafc732437c01"
},
"require": {
"typo3/cms-core": "8.5.0 - 8.9.99"
},
"replace": {
"t3o_slack": "self.version",
"typo3-ter/t3o_slack": "self.version"
},
"type": "typo3-cms-extension",
"autoload": {
"psr-4": {
"T3o\\T3oSlack\\": "Classes/"
}
},
"license": [
"GPL-3.0+"
],
"description": "Sign Up for a slack installation",
"keywords": [
"Slack",
"TYPO3 CMS"
],
"support": {
"email": "maintenance@typo3.org",
"issues": "https://github.com/TYPO3-typo3org/t3o_slack/issues"
},
"time": "2018-05-06T07:03:56+00:00"
},
{
"name": "t3o/t3olayout",
"version": "3.0.0",
"version": "3.0.4",
"source": {
"type": "git",
"url": "https://git-t3o.typo3.org/t3o/t3olayout.git",
"reference": "380166330ac366be2467bee002b481f102103345"
"reference": "bc64be6d7129e7ca8cb09ecd9987db985eae0ed2"
},
"require": {
"gridelementsteam/gridelements": "^8.0",
......@@ -2112,44 +2144,7 @@
"keywords": [
"TYPO3 CMS"
],
"time": "2018-06-06T18:52:47+00:00"
},
{
"name": "typo3-ter/femanager",
"version": "4.2.2",
"dist": {
"type": "zip",
"url": "https://extensions.typo3.org/extension/download/femanager/4.2.2/zip/",
"reference": null,
"shasum": null
},
"require": {
"php": ">= 7.0.0, <= 7.2.99",
"typo3/cms-core": ">= 8.7.0, <= 8.7.99"
},
"replace": {
"femanager": "self.version"
},
"suggest": {
"typo3-ter/sr-freecap": ">= 2.3.0, <= 2.99.99",
"typo3-ter/static-info-tables": ">= 6.0.0, <= 6.99.99"
},
"type": "typo3-cms-extension",
"autoload": {
"psr-4": {
"In2code\\Femanager\\": "Classes/"
}
},
"authors": [
{
"name": "Alexander Kellner, Stefan Busemann",
"email": "info@in2code.de",
"company": "in2code.de - Wir leben TYPO3",
"username": "in2code"
}
],
"description": "TYPO3 Frontend User Registration and Management based on\n Extbase and Fluid and on TYPO3 8 and the possibility to extend it.\n Extension basicly works like sr_feuser_register",
"time": "2018-05-11T13:49:48+00:00"
"time": "2018-06-23T12:01:52+00:00"
},
{
"name": "typo3-ter/ig-ldap-sso-auth",
......@@ -2245,16 +2240,16 @@
},
{
"name": "typo3/cms",
"version": "v8.7.15",
"version": "v8.7.16",
"source": {
"type": "git",
"url": "https://github.com/TYPO3/TYPO3.CMS.git",
"reference": "799725362be3d260d9b214dcdd8faa2525003724"
"reference": "f02a014e16881b0271dda9a4a1a63ec9748b0210"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3/TYPO3.CMS/zipball/799725362be3d260d9b214dcdd8faa2525003724",
"reference": "799725362be3d260d9b214dcdd8faa2525003724",
"url": "https://api.github.com/repos/TYPO3/TYPO3.CMS/zipball/f02a014e16881b0271dda9a4a1a63ec9748b0210",
"reference": "f02a014e16881b0271dda9a4a1a63ec9748b0210",
"shasum": ""
},
"require": {
......@@ -2446,7 +2441,7 @@
"extbase",
"typo3"
],
"time": "2018-05-23T11:31:21+00:00"
"time": "2018-06-11T17:18:14+00:00"
},
{
"name": "typo3/cms-composer-installers",
......@@ -2564,5 +2559,8 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
"platform-dev": [],
"platform-overrides": {
"php": "7.0.30"
}
}
......@@ -2,7 +2,6 @@
/** #ddev-generated: Automatically generated TYPO3 AdditionalConfiguration.php file.
ddev manages this file and may delete or overwrite the file unless this comment is removed.
*/
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default'], [
......@@ -23,4 +22,4 @@ $GLOBALS['TYPO3_CONF_VARS']['MAIL'] = [
];
$GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword'] = '$P$CZqeoYBTHC0kXKny4tpTvBSzzV5wVY0'; /* joh316 */
$GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'] = 'normal';
\ No newline at end of file
$GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'] = 'normal';
#
# Global Git ignore file
# inspired by the TYPO3 Project
#
# ignoring temporary/backup files (left by e.g. vim)
# ignoring common IDE's config directories/files
# ignoring thumbnail db files
#
# for local exclude patterns please edit .git/info/exclude
#
*~
*.bak
*.idea
*.project
Thumbs.db
desktop.ini
<?php
namespace T3o\T3oSlack\Command;
use T3o\T3oSlack\Domain\Model\SlackUser;
use T3o\T3oSlack\Domain\Service\SlackApi;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\CommandController;
/***************************************************************
* Copyright notice
*
* (c) 2017
* All rights reserved
*
* @author Stefan Busemann <stefan@in2code.de>
* @package TYPO3
* @subpackage t3o_slack
*
* This script is part of the TYPO3 project. The TYPO3 project 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.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
class SlackImportCommandController extends CommandController
{
/**
* @var \T3o\T3oSlack\Domain\Repository\SlackUserRepository
* @inject
*/
public $slackUserRepository;
/**
* @var array
*/
public $settings;
/**
* @var \T3o\T3oSlack\Domain\Service\SlackApi;
*/
public $slackApi;
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @inject
*/
protected $configurationManager;
/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager
* @inject
*/
protected $persistenceManager;
/**
* Import all Slack Users
*
* @return string '1' for success, '0' for error
* @throws \Exception
*/
public function importCommand()
{
$this->getTSConfiguration();
// delete all uses before fresh import
$this->slackUserRepository->removeAll();
$this->persistenceManager->persistAll();
$this->slackApi = GeneralUtility::makeInstance(SlackApi::class);
$cursor = '';
$limiter = 0;
$counter = 0;
do {
$response = $this->slackApi->getUsers($cursor);
if (!$response['ok']) {
throw new \Exception('Slack API error . Reason: ' . $response['error']);
}
foreach ($response['members'] as $member) {
if ($member['is_bot'] == false) {
$slackUser = GeneralUtility::makeInstance(SlackUser::class);
$slackUser->setEmail($member['profile']['email']);
$slackUser->setRealName($member['real_name']);
$slackUser->setSlackId($member['id']);
$slackUser->setSlackUserName($member['name']);
$counter++;
$this->slackUserRepository->add($slackUser);
}
}
if ($response['response_metadata']['next_cursor']) {
$cursor = $response['response_metadata']['next_cursor'];
} else {
$cursor = '';
}
$this->persistenceManager->persistAll();
$limiter++;
if ($limiter > 999) {
// break loop, if we have more then 999 loops
throw new \Exception('Slack import stopped, due to many loops.');
}
} while ($cursor);
$GLOBALS['BE_USER']->simplelog(
'Import of Slack User sucessful - imported ' . $counter . ' users',
't3o_slack'
);
return '1';
}
protected function getTSConfiguration()
{
// load complete ts
$this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);