Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ghost settings and system settings props updating in account (#34)
* added system settings props update to account * added ghost settings updating * creating account with values logic * fixed validation and AccountValues model submitting * added translations * minor * moved mail settings from Account to AccountValues model * simplisfied scenarios * removed useless legends * minor * updated 'set-system-settings' action params validation type
- Loading branch information
1 parent
d709545
commit 669d4a6
Showing
11 changed files
with
327 additions
and
30 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
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
/** | ||
* Hosting Plugin for HiPanel | ||
* | ||
* @link https://github.com/hiqdev/hipanel-module-hosting | ||
* @package hipanel-module-hosting | ||
* @license BSD-3-Clause | ||
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) | ||
*/ | ||
|
||
namespace hipanel\modules\hosting\models; | ||
|
||
use Yii; | ||
|
||
/** | ||
* Class AccountValues | ||
* @package hipanel\modules\hosting\models | ||
*/ | ||
class AccountValues extends \hipanel\base\Model | ||
{ | ||
use \hipanel\base\ModelTrait; | ||
|
||
const SCENARIO_DEFAULT = 'dumb'; | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function tableName() | ||
{ | ||
return 'account'; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function rules() | ||
{ | ||
return array_merge(parent::rules(), [ | ||
[['id'], 'integer'], | ||
[['no_suexec', 'allow_scripts', 'dont_enable_ssi', 'block_send'], 'boolean'], | ||
[ | ||
[ | ||
'id', 'per_hour_limit', 'block_send', | ||
'no_suexec', 'allow_scripts', 'dont_enable_ssi', | ||
'port', 'global_apache_conf', 'global_nginx_conf', | ||
'apache_conf', 'nginx_conf', 'nginx_listen', | ||
'domain_prefix', 'docroot_postfix', 'cgibin_postfix', | ||
], | ||
'safe', | ||
'on' => ['default', 'set-ghost-options', 'set-mail-settings'], | ||
], | ||
]); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return $this->mergeAttributeLabels([ | ||
'no_suexec' => Yii::t('hipanel:hosting:account', 'No Suexec'), | ||
'allow_scripts' => Yii::t('hipanel:hosting:account', 'Allow scripts'), | ||
'dont_enable_ssi' => Yii::t('hipanel:hosting:account', 'Dont enable Ssi'), | ||
'port' => Yii::t('hipanel:hosting:account', 'Port'), | ||
'global_apache_conf' => Yii::t('hipanel:hosting:account', 'Global Apache configuration'), | ||
'global_nginx_conf' => Yii::t('hipanel:hosting:account', 'Global Nginx configuration'), | ||
'apache_conf' => Yii::t('hipanel:hosting:account', 'Apache configuration'), | ||
'nginx_conf' => Yii::t('hipanel:hosting:account', 'Nginx configuration'), | ||
'domain_prefix' => Yii::t('hipanel:hosting:account', 'Domain prefix'), | ||
'nginx_listen' => Yii::t('hipanel:hosting:account', 'Nginx listen'), | ||
'docroot_postfix' => Yii::t('hipanel:hosting:account', 'Document root postfix'), | ||
'cgibin_postfix' => Yii::t('hipanel:hosting:account', 'Cgibin postfix'), | ||
'block_send' => Yii::t('hipanel:hosting', 'Block outgoing post'), | ||
'per_hour_limit' => Yii::t('hipanel:hosting', 'Maximum letters per hour'), | ||
]); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public static function primaryKey() | ||
{ | ||
return ['id']; | ||
} | ||
} |
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,42 @@ | ||
<?php | ||
/** | ||
* Hosting module for HiPanel | ||
* | ||
* @link https://github.com/hiqdev/hipanel-module-hosting | ||
* @package hipanel-module-hosting | ||
* @license BSD-3-Clause | ||
* @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) | ||
*/ | ||
|
||
namespace hipanel\modules\hosting\models\query; | ||
|
||
use hiqdev\hiart\ActiveQuery; | ||
|
||
/** | ||
* Class AccountQuery | ||
* @package hipanel\modules\hosting\models\query | ||
*/ | ||
class AccountQuery extends ActiveQuery | ||
{ | ||
/** | ||
* @return $this | ||
*/ | ||
public function withValues(): self | ||
{ | ||
$this->joinWith('values'); | ||
$this->andWhere(['with_values' => true]); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return $this | ||
*/ | ||
public function withBlocking(): self | ||
{ | ||
$this->joinWith('blocking'); | ||
$this->andWhere(['with_blocking' => true]); | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.