Removed yiigii module by default

This commit is contained in:
Lucas Bartholemy 2014-07-02 08:20:16 +02:00
parent b8f342a06d
commit d1fa8b02a2
8 changed files with 0 additions and 240 deletions

View File

@ -1,28 +0,0 @@
<?php
class YiiGiiModule extends HWebModule {
public function init() {
$this->setImport(array(
'yiigii.forms.*',
'yiigii.controllers.*',
'yiigii.*',
));
}
public static function onWebApplicationInit($event) {
Yii::app()->setModules(array(
'gii' => array(
'class' => 'system.gii.GiiModule',
'password' => HSetting::Get('password', 'yiigii'),
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters' => explode(",", str_replace(" ", "",HSetting::Get('ipFilters', 'yiigii'))),
'generatorPaths' => array(
'bootstrap.gii',
),
),
));
}
}

View File

@ -1,17 +0,0 @@
<?php
Yii::app()->moduleManager->register(array(
'id' => 'yiigii',
'title' => Yii::t('YiiGiiModule.base', 'Yii - Gii Module'),
'description' => Yii::t('YiiGiiModule.base', 'Includes Yiis Automatic Code Generator (Gii)'),
'class' => 'application.modules.yiigii.YiiGiiModule',
'import' => array(
'application.modules.yiigii.*',
),
'configRoute' => '//yiigii/config/index',
// Events to Catch
'events' => array(
array('class' => 'WebApplication', 'event' => 'onInit', 'callback' => array('YiiGiiModule', 'onWebApplicationInit')),
),
));
?>

View File

@ -1,69 +0,0 @@
<?php
class ConfigController extends Controller {
public $subLayout = "application.modules_core.admin.views._layout";
/**
* @return array action filters
*/
public function filters() {
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules() {
return array(
array('allow',
'expression' => 'Yii::app()->user->isAdmin()',
),
array('deny', // deny all users
'users' => array('*'),
),
);
}
/**
* Configuration Action for Super Admins
*/
public function actionIndex() {
Yii::import('yiigii.forms.*');
$form = new ConfigureForm;
// uncomment the following code to enable ajax-based validation
if (isset($_POST['ajax']) && $_POST['ajax'] === 'configure-form') {
echo CActiveForm::validate($form);
Yii::app()->end();
}
if (isset($_POST['ConfigureForm'])) {
$_POST['ConfigureForm'] = Yii::app()->input->stripClean($_POST['ConfigureForm']);
$form->attributes = $_POST['ConfigureForm'];
if ($form->validate()) {
$form->password = HSetting::Set('password', $form->password, 'yiigii');
$form->ipFilters = HSetting::Set('ipFilters', $form->ipFilters, 'yiigii');
$this->redirect(Yii::app()->createUrl('yiigii/config/index'));
}
} else {
$form->password = HSetting::Get('password', 'yiigii');
$form->ipFilters = HSetting::Get('ipFilters', 'yiigii');
}
$this->render('index', array('model' => $form));
}
}
?>

View File

@ -1,30 +0,0 @@
<?php
class ConfigureForm extends CFormModel {
public $password;
public $ipFilters;
/**
* Declares the validation rules.
*/
public function rules() {
return array(
array('password', 'required'),
array('ipFilters', 'safe'),
);
}
/**
* Declares customized attribute labels.
* If not declared here, an attribute would have a label that is
* the same as its name with the first letter in upper case.
*/
public function attributeLabels() {
return array(
'password' => Yii::t('YiiGiiModule.base', 'Gii Password'),
'ipFilters' => Yii::t('YiiGiiModule.base', 'Limit IPs (Comma Separated)'),
);
}
}

View File

@ -1,26 +0,0 @@
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yiic message' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE, this file must be saved in UTF-8 encoding.
*/
return array (
'Gii Configuration' => '',
'Gii Password' => '',
'If removed, Gii defaults to localhost only. Edit carefully to taste.' => '',
'Includes Yiis Automatic Code Generator (Gii)' => '',
'Limit IPs (Comma Separated)' => '',
'Yii - Gii Module' => '',
);

View File

@ -1,26 +0,0 @@
<?php
/**
* Message translations.
*
* This file is automatically generated by 'yiic message' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE, this file must be saved in UTF-8 encoding.
*/
return array (
'Gii Configuration' => '',
'Gii Password' => '',
'If removed, Gii defaults to localhost only. Edit carefully to taste.' => '',
'Includes Yiis Automatic Code Generator (Gii)' => '',
'Limit IPs (Comma Separated)' => '',
'Yii - Gii Module' => '',
);

View File

@ -1,11 +0,0 @@
l
{ "id": "yiigii",
"name": "Yii Gii Integration",
"description": "Integrates Yii Code Generator for HumHub Developers",
"keywords": ["yii", "gii", "development"],
"version": "0.9",
"humhub": {
"minVersion": "0.5",
"maxVersion": "0.7"
}
}

View File

@ -1,33 +0,0 @@
<h1><?php echo Yii::t('YiiGiiModule.base', 'Gii Configuration'); ?></h1>
<p><?php echo Yii::t('YiiGiiModule.base', 'You can access Gii via: {url}.', array('{url}' => CHtml::link($this->createAbsoluteUrl('//gii'),$this->createUrl('//gii')))); ?>
<?php
$form = $this->beginWidget('CActiveForm', array(
'id' => 'configure-form',
'enableAjaxValidation' => true,
));
?>
<?php echo $form->errorSummary($model); ?>
<div class="form-group">
<?php echo $form->labelEx($model, 'password'); ?>
<?php echo $form->textField($model, 'password', array('class' => 'form-control')); ?>
<?php echo $form->error($model, 'password'); ?>
</div>
<div class="form-group">
<?php echo $form->labelEx($model, 'ipFilters'); ?>
<?php echo $form->textField($model, 'ipFilters', array('class' => 'form-control')); ?>
<?php echo $form->error($model, 'ipFilters'); ?>
<p class="help-block"><?php echo Yii::t('YiiGiiModule.base', 'If removed, Gii defaults to localhost only. Edit carefully to taste.'); ?></p>
</div>
<hr>
<?php echo CHtml::submitButton(Yii::t('base', 'Save'), array('class' => 'btn btn-primary')); ?>
<a class="btn btn-default" href="<?php echo $this->createUrl('//admin/module'); ?>"><?php echo Yii::t('AdminModule.base', 'Back to modules'); ?></a>
<?php $this->endWidget(); ?>