Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite Setup settings forms as classes
Signed-off-by: Michal Čihař <michal@cihar.com>
- Loading branch information
Showing
15 changed files
with
303 additions
and
419 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,23 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
use PhpMyAdmin\Config\Forms\BaseForm; | ||
|
||
class ConfigForm extends BaseForm | ||
{ | ||
public static function getForms() | ||
{ | ||
return array( | ||
'Config' => array( | ||
'DefaultLang', | ||
'ServerDefault' | ||
), | ||
); | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm | ||
{ | ||
} |
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,60 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm | ||
{ | ||
public static function getForms() | ||
{ | ||
$result = parent::getForms(); | ||
/* Remove only_db/hide_db, we have proper Server form in setup */ | ||
$result['Databases'] = array_diff( | ||
$result['Databases'], | ||
['Servers/1/only_db', 'Servers/1/hide_db'] | ||
); | ||
/* Following are not available to user */ | ||
$result['Import_export'] = array( | ||
'UploadDir', | ||
'SaveDir', | ||
'RecodingEngine' => ':group', | ||
'IconvExtraParams', | ||
':group:end', | ||
'ZipDump', | ||
'GZipDump', | ||
'BZipDump', | ||
'CompressOnFly' | ||
); | ||
$result['Security'] = array( | ||
'blowfish_secret', | ||
'CheckConfigurationPermissions', | ||
'TrustedProxies', | ||
'AllowUserDropDatabase', | ||
'AllowArbitraryServer', | ||
'ArbitraryServerRegexp', | ||
'LoginCookieRecall', | ||
'LoginCookieStore', | ||
'LoginCookieDeleteAll', | ||
'CaptchaLoginPublicKey', | ||
'CaptchaLoginPrivateKey' | ||
); | ||
$result['Developer'][] = 'UserprefsDeveloperTab'; | ||
$result['Other_core_settings'] = array( | ||
'OBGzip', | ||
'PersistentConnections', | ||
'ExecTimeLimit', | ||
'MemoryLimit', | ||
'UseDbSearch', | ||
'ProxyUrl', | ||
'ProxyUser', | ||
'ProxyPass', | ||
'AllowThirdPartyFraming', | ||
'ZeroConf', | ||
); | ||
return $result; | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm | ||
{ | ||
} |
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,20 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class MainForm extends \PhpMyAdmin\Config\Forms\User\MainForm | ||
{ | ||
public static function getForms() | ||
{ | ||
$result = parent::getForms(); | ||
/* Following are not available to user */ | ||
$result['Startup'][] = 'ShowPhpInfo'; | ||
$result['Startup'][] = 'ShowChgPassword'; | ||
return $result; | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm | ||
{ | ||
} |
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,81 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
use PhpMyAdmin\Config\Forms\BaseForm; | ||
|
||
class ServersForm extends BaseForm | ||
{ | ||
public static function getForms() | ||
{ | ||
return array( | ||
'Server' => array('Servers' => array(1 => array( | ||
'verbose', | ||
'host', | ||
'port', | ||
'socket', | ||
'ssl', | ||
'compress'))), | ||
'Server_auth' => array('Servers' => array(1 => array( | ||
'auth_type', | ||
':group:' . __('Config authentication'), | ||
'user', | ||
'password', | ||
':group:end', | ||
':group:' . __('HTTP authentication'), | ||
'auth_http_realm', | ||
':group:end', | ||
':group:' . __('Signon authentication'), | ||
'SignonSession', | ||
'SignonURL', | ||
'LogoutURL'))), | ||
'Server_config' => array('Servers' => array(1 => array( | ||
'only_db', | ||
'hide_db', | ||
'AllowRoot', | ||
'AllowNoPassword', | ||
'DisableIS', | ||
'AllowDeny/order', | ||
'AllowDeny/rules', | ||
'SessionTimeZone'))), | ||
'Server_pmadb' => array('Servers' => array(1 => array( | ||
'pmadb' => 'phpmyadmin', | ||
'controlhost', | ||
'controlport', | ||
'controluser', | ||
'controlpass', | ||
'bookmarktable' => 'pma__bookmark', | ||
'relation' => 'pma__relation', | ||
'userconfig' => 'pma__userconfig', | ||
'users' => 'pma__users', | ||
'usergroups' => 'pma__usergroups', | ||
'navigationhiding' => 'pma__navigationhiding', | ||
'table_info' => 'pma__table_info', | ||
'column_info' => 'pma__column_info', | ||
'history' => 'pma__history', | ||
'recent' => 'pma__recent', | ||
'favorite' => 'pma__favorite', | ||
'table_uiprefs' => 'pma__table_uiprefs', | ||
'tracking' => 'pma__tracking', | ||
'table_coords' => 'pma__table_coords', | ||
'pdf_pages' => 'pma__pdf_pages', | ||
'savedsearches' => 'pma__savedsearches', | ||
'central_columns' => 'pma__central_columns', | ||
'designer_settings' => 'pma__designer_settings', | ||
'export_templates' => 'pma__export_templates', | ||
'MaxTableUiprefs' => 100))), | ||
'Server_tracking' => array('Servers' => array(1 => array( | ||
'tracking_version_auto_create', | ||
'tracking_default_statements', | ||
'tracking_add_drop_view', | ||
'tracking_add_drop_table', | ||
'tracking_add_drop_database', | ||
))), | ||
); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* Setup preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
use PhpMyAdmin\Config\Forms\BaseFormList; | ||
|
||
class SetupFormList extends BaseFormList | ||
{ | ||
protected static $all = array( | ||
'Config', | ||
'Export', | ||
'Features', | ||
'Import', | ||
'Main', | ||
'Navi', | ||
'Servers', | ||
'Sql', | ||
); | ||
protected static $ns = 'PhpMyAdmin\\Config\\Forms\\Setup\\'; | ||
} |
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,19 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* User preferences form | ||
* | ||
* @package PhpMyAdmin | ||
*/ | ||
namespace PhpMyAdmin\Config\Forms\Setup; | ||
|
||
class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm | ||
{ | ||
public static function getForms() | ||
{ | ||
$result = parent::getForms(); | ||
/* Following are not available to user */ | ||
$result['Sql_queries'][] = 'QueryHistoryDB'; | ||
return $result; | ||
} | ||
} |
Oops, something went wrong.