Thanks to lendulado from the forums for these suggestions.
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)
<?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 : */
<?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>
<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']);
$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" />
* @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 ) {
?>
?>
<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']; ?>
</tr>
<?php
- foreach ( $category['items'] as $item ) {
+ foreach ($category['items'] as $item) {
$value = $from[$item['var']];
}
/* 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']);
'description' => USERCONF_USERLEVEL_DESC . "\n" . USERLEVEL_OBSOLETE,
'type' => 'list',
'default' => $serendipity['permissionLevels'],
- 'permission' => 'personalConfigurationUserlevel'),
+ 'permission' => 'personalConfigurationUserlevel',
+ 'view' => 'dangerous'),
array('var' => 'groups',
'title' => USERCONF_GROUPS,
'description' => USERCONF_GROUPS_DESC,
'type' => 'multilist',
'permission' => array('adminUsersMaintainOthers', 'adminUsersMaintainSame'),
- 'perm_mode' => 'or',
+ 'perm_mode' => 'or',
'default' => serendipity_getAllGroups(),
- 'flags' => array('groups')),
+ 'flags' => array('groups'),
+ 'view' => 'dangerous'),
array('var' => 'email',
'title' => USERCONF_EMAIL,
'permission' => 'personalConfiguration',
'flags' => array('config')),
+ array('var' => 'eyecandy',
+ 'title' => PREFERENCE_USE_JS,
+ 'description' => PREFERENCE_USE_JS_DESC,
+ 'type' => 'bool',
+ 'default' => true,
+ 'permission' => 'personalConfiguration',
+ 'flags' => array('config')),
+
array('var' => 'mail_comments',
'title' => USERCONF_SENDCOMMENTS,
'description' => USERCONF_SENDCOMMENTS_DESC,
'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'] =
'default' => array('publish' => PUBLISH, 'draft' => DRAFT),
'permission' => 'personalConfiguration',
'flags' => array('config')),
+
+ array('var' => 'showMediaToolbar',
+ 'title' => SHOW_MEDIA_TOOLBAR,
+ 'description' => '',
+ 'type' => 'bool',
+ 'default' => false,
+ 'permission' => 'personalConfiguration',
+ 'flags' => array('config')),
));
return $res;
-?>