-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from humhub/enh/php-cs-fixer
Use PHP CS Fixer
- Loading branch information
Showing
19 changed files
with
130 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: PHP CS Fixer | ||
|
||
on: push | ||
|
||
jobs: | ||
fixers: | ||
uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,74 @@ | ||
<?php | ||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\legal\controllers; | ||
|
||
use humhub\modules\legal\Module; | ||
use humhub\modules\legal\services\ExportService; | ||
use humhub\modules\user\components\BaseAccountController; | ||
use Yii; | ||
use yii\web\BadRequestHttpException; | ||
use yii\web\NotFoundHttpException; | ||
|
||
/* @property Module $module */ | ||
class ExportController extends BaseAccountController | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function getAccessRules() | ||
{ | ||
return array_merge(parent::getAccessRules(), [ | ||
['checkEnabledExportUserData'], | ||
]); | ||
} | ||
|
||
public function checkEnabledExportUserData($rule, $access) | ||
{ | ||
return $this->module->isEnabledExportUserData(); | ||
} | ||
|
||
public function actionIndex() | ||
{ | ||
return $this->render('index', [ | ||
'service' => ExportService::instance(), | ||
]); | ||
} | ||
|
||
public function actionRequest() | ||
{ | ||
if (ExportService::instance()->requestPackage()) { | ||
$this->view->success(Yii::t('LegalModule.base', 'The exporting of your data has been started, please wait some time.')); | ||
} else { | ||
$this->view->error('Cannot start the exporting of your data, please try again.'); | ||
} | ||
|
||
return $this->redirect(['index']); | ||
} | ||
|
||
public function actionDownload() | ||
{ | ||
$package = ExportService::instance()->downloadPackage(); | ||
|
||
if ($package === null) { | ||
throw new NotFoundHttpException(); | ||
} | ||
|
||
return $package; | ||
} | ||
|
||
public function actionDelete() | ||
{ | ||
if (ExportService::instance()->deletePackage()) { | ||
$this->view->success(Yii::t('LegalModule.base', 'The package has been deleted.')); | ||
} else { | ||
$this->view->error('Cannot delete the package, please try again.'); | ||
} | ||
|
||
return $this->redirect(['index']); | ||
} | ||
} | ||
<?php | ||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\legal\controllers; | ||
|
||
use humhub\modules\legal\Module; | ||
use humhub\modules\legal\services\ExportService; | ||
use humhub\modules\user\components\BaseAccountController; | ||
use Yii; | ||
use yii\web\BadRequestHttpException; | ||
use yii\web\NotFoundHttpException; | ||
|
||
/* @property Module $module */ | ||
class ExportController extends BaseAccountController | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function getAccessRules() | ||
{ | ||
return array_merge(parent::getAccessRules(), [ | ||
['checkEnabledExportUserData'], | ||
]); | ||
} | ||
|
||
public function checkEnabledExportUserData($rule, $access) | ||
{ | ||
return $this->module->isEnabledExportUserData(); | ||
} | ||
|
||
public function actionIndex() | ||
{ | ||
return $this->render('index', [ | ||
'service' => ExportService::instance(), | ||
]); | ||
} | ||
|
||
public function actionRequest() | ||
{ | ||
if (ExportService::instance()->requestPackage()) { | ||
$this->view->success(Yii::t('LegalModule.base', 'The exporting of your data has been started, please wait some time.')); | ||
} else { | ||
$this->view->error('Cannot start the exporting of your data, please try again.'); | ||
} | ||
|
||
return $this->redirect(['index']); | ||
} | ||
|
||
public function actionDownload() | ||
{ | ||
$package = ExportService::instance()->downloadPackage(); | ||
|
||
if ($package === null) { | ||
throw new NotFoundHttpException(); | ||
} | ||
|
||
return $package; | ||
} | ||
|
||
public function actionDelete() | ||
{ | ||
if (ExportService::instance()->deletePackage()) { | ||
$this->view->success(Yii::t('LegalModule.base', 'The package has been deleted.')); | ||
} else { | ||
$this->view->error('Cannot delete the package, please try again.'); | ||
} | ||
|
||
return $this->redirect(['index']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
|
||
class uninstall extends Migration | ||
{ | ||
|
||
public function up() | ||
{ | ||
$this->dropTable('legal_page'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.