Improve usability by removing possibly dangerous options from personal configuration and moving them to the user management. Also rename the description options for those options.
Thanks to lendulado from the forums for these suggestions.
This commit is contained in:
parent
34096e897a
commit
8f0925079d
@ -3,6 +3,11 @@
|
||||
Version 1.2 ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Move possible hazardous personal configuration options ("Rights:
|
||||
Publishing entries", "Forbid creating entries", "Access level";
|
||||
"Group memberships") to the user management section.
|
||||
(garvinhicking)
|
||||
|
||||
* Fix track exit url ids off by one when being used in conjunction
|
||||
with caching plugin (garvinhicking)
|
||||
|
||||
|
@ -493,6 +493,10 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
|
||||
<?php serendipity_plugin_api::hook_event('backend_plugins_event_header', $serendipity); ?>
|
||||
<?php show_plugins(true); ?>
|
||||
|
||||
<h3>Memory Usage</h3>
|
||||
<div>
|
||||
<pre><?php print_r($serendipity['memSnaps']); ?></pre>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
/* vim: set sts=4 ts=4 expandtab : */
|
||||
|
@ -201,7 +201,7 @@ foreach($users as $user) {
|
||||
<?php /* TODO: Add username to list once tom figures out how to fix uneven rowstyles */ ?>
|
||||
<td><img src="<?php echo $img ?>" alt="" style="border: 0px none ; vertical-align: bottom; display: inline;" /> <?php echo htmlspecialchars($user['realname']); ?></td>
|
||||
<td width="100" align="center"><?php echo $user['userlevel']; ?></td>
|
||||
<td width="200" align="right"> [<a href="?serendipity[adminModule]=users&serendipity[adminAction]=edit&serendipity[userid]=<?php echo $user['authorid'] ?>"><?php echo EDIT ?></a>]
|
||||
<td width="200" align="right"> [<a href="?serendipity[adminModule]=users&serendipity[adminAction]=edit&serendipity[userid]=<?php echo $user['authorid'] ?>#editform"><?php echo EDIT ?></a>]
|
||||
- [<a href="?serendipity[adminModule]=users&serendipity[adminAction]=delete&serendipity[userid]=<?php echo $user['authorid'] ?>"><?php echo DELETE ?></a>]</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -232,12 +232,13 @@ if ( ($serendipity['GET']['adminAction'] == 'edit' && serendipity_checkPermissio
|
||||
<br />
|
||||
<br />
|
||||
<hr noshade="noshade">
|
||||
<form action="?serendipity[adminModule]=users" method="post">
|
||||
<form action="?serendipity[adminModule]=users#editform" method="post">
|
||||
<?php echo serendipity_setFormToken(); ?>
|
||||
<div>
|
||||
<h3>
|
||||
<?php
|
||||
if ($serendipity['GET']['adminAction'] == 'edit') {
|
||||
echo '<a id="editform"></a>';
|
||||
$user = serendipity_fetchUsers($serendipity['GET']['userid']);
|
||||
$group_intersect = serendipity_intersectGroup($user[0]['authorid']);
|
||||
|
||||
@ -271,7 +272,7 @@ if (!empty($serendipity['GET']['userid'])) {
|
||||
$from['groups'] = array();
|
||||
}
|
||||
|
||||
serendipity_printConfigTemplate($config, $from, true, false);
|
||||
serendipity_printConfigTemplate($config, $from, true, false, true, true);
|
||||
|
||||
if ($serendipity['GET']['adminAction'] == 'edit') { ?>
|
||||
<input type="submit" name="SAVE_EDIT" value="<?php echo SAVE; ?>" class="serendipityPrettyButton" />
|
||||
|
@ -451,9 +451,10 @@ function serendipity_guessInput($type, $name, $value='', $default='') {
|
||||
* @param boolean If true, no HTML FORM container will be emitted
|
||||
* @param boolean If true, the configuration sections will all be folded
|
||||
* @param boolean If true, the user can turn config sections on and off
|
||||
* @param boolean If true, the user can NOT display possibly dangerous options
|
||||
* @return null
|
||||
*/
|
||||
function serendipity_printConfigTemplate($config, $from = false, $noForm = false, $folded = true, $allowToggle = true) {
|
||||
function serendipity_printConfigTemplate($config, $from = false, $noForm = false, $folded = true, $allowToggle = true, $showDangerous = false) {
|
||||
global $serendipity;
|
||||
if ( $allowToggle ) {
|
||||
?>
|
||||
@ -518,7 +519,7 @@ function showConfigAll(count) {
|
||||
?>
|
||||
<tr>
|
||||
<th align="left" colspan="2" style="padding-left: 15px;">
|
||||
<?php if ( $allowToggle ) { ?>
|
||||
<?php if ($allowToggle) { ?>
|
||||
<a style="border:0; text-decoration: none;" href="#" onClick="showConfig('el<?php echo $el_count; ?>'); return false" title="<?php echo TOGGLE_OPTION; ?>"><img src="<?php echo serendipity_getTemplateFile('img/'. ($folded === true ? 'plus' : 'minus') .'.png') ?>" id="optionel<?php echo $el_count; ?>" alt="+/-" border="0" /> <?php echo $category['title']; ?></a>
|
||||
<?php } else { ?>
|
||||
<?php echo $category['title']; ?>
|
||||
@ -536,7 +537,7 @@ function showConfigAll(count) {
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
foreach ( $category['items'] as $item ) {
|
||||
foreach ($category['items'] as $item) {
|
||||
|
||||
$value = $from[$item['var']];
|
||||
|
||||
@ -546,13 +547,17 @@ function showConfigAll(count) {
|
||||
}
|
||||
|
||||
/* Check for installOnly flag */
|
||||
if ( in_array('installOnly', $item['flags']) && IS_installed === true ) {
|
||||
if (in_array('installOnly', $item['flags']) && IS_installed === true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( in_array('hideValue', $item['flags']) ) {
|
||||
if (in_array('hideValue', $item['flags'])) {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
if (!$showDangerous && $item['view'] == 'dangerous') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array('config', $item['flags']) && isset($from['authorid'])) {
|
||||
$value = serendipity_get_user_config_var($item['var'], $from['authorid'], $item['default']);
|
||||
|
@ -41,7 +41,8 @@
|
||||
'description' => USERCONF_USERLEVEL_DESC . "\n" . USERLEVEL_OBSOLETE,
|
||||
'type' => 'list',
|
||||
'default' => $serendipity['permissionLevels'],
|
||||
'permission' => 'personalConfigurationUserlevel'),
|
||||
'permission' => 'personalConfigurationUserlevel',
|
||||
'view' => 'dangerous'),
|
||||
|
||||
array('var' => 'groups',
|
||||
'title' => USERCONF_GROUPS,
|
||||
@ -50,7 +51,8 @@
|
||||
'permission' => array('adminUsersMaintainOthers', 'adminUsersMaintainSame'),
|
||||
'perm_mode' => 'or',
|
||||
'default' => serendipity_getAllGroups(),
|
||||
'flags' => array('groups')),
|
||||
'flags' => array('groups'),
|
||||
'view' => 'dangerous'),
|
||||
|
||||
array('var' => 'email',
|
||||
'title' => USERCONF_EMAIL,
|
||||
@ -103,14 +105,16 @@
|
||||
'type' => 'bool',
|
||||
'default' => false,
|
||||
'permission' => 'personalConfigurationNoCreate',
|
||||
'flags' => array('config')),
|
||||
'flags' => array('config'),
|
||||
'view' => 'dangerous'),
|
||||
|
||||
array('var' => 'right_publish',
|
||||
'title' => USERCONF_ALLOWPUBLISH,
|
||||
'description' => USERCONF_ALLOWPUBLISH_DESC,
|
||||
'type' => 'bool',
|
||||
'default' => true,
|
||||
'permission' => 'personalConfigurationRightPublish')
|
||||
'permission' => 'personalConfigurationRightPublish',
|
||||
'view' => 'dangerous')
|
||||
));
|
||||
|
||||
$res['defaults'] =
|
||||
@ -151,4 +155,3 @@
|
||||
));
|
||||
|
||||
return $res;
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user