working on per-user permissions
This commit is contained in:
parent
1f98d874c4
commit
b274c28d03
|
@ -908,6 +908,8 @@ class WhatDidTheySayAdmin {
|
|||
$available_filters = $this->_get_available_override_filters();
|
||||
$suggested_amount = 20 + ($this->transcript_count * 0.1);
|
||||
|
||||
$users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login");
|
||||
|
||||
include('partials/admin.inc');
|
||||
}
|
||||
|
||||
|
|
|
@ -29,5 +29,42 @@
|
|||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<h3><?php _e('Per-user Permissions', 'what-did-they-say') ?></h3>
|
||||
|
||||
<p><?php _e('Give specified users permissions above and beyond their role permissions.', 'what-did-they-say') ?></p>
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden" name="wdts[_nonce]" value="<?php echo $nonce ?>" />
|
||||
<input type="hidden" name="wdts[module]" value="user-capabilities" />
|
||||
<table class="widefat fixed">
|
||||
<tr>
|
||||
<th width="15%">Login</th>
|
||||
<th colspan="3">Capabilities</th>
|
||||
</tr>
|
||||
<?php foreach ((array)$users as $user) {
|
||||
$user_capabilities = get_usermeta($user->ID, 'transcript_capabilities');
|
||||
if (!is_array($user_capabilities)) { $user_capabilities = array(); }
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php echo $user->user_login ?></th>
|
||||
<?php foreach ($this->capabilities as $key => $label) { ?>
|
||||
<td>
|
||||
<label style="white-space: nowrap">
|
||||
<input type="checkbox" name="wdts[user_capabilities][<?php echo $user->ID ?>][<?php echo $key ?>]" value="yes" />
|
||||
<?php echo $label ?>
|
||||
</label>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="3">
|
||||
<input type="submit" value="<?php _e('Update per-user permissions', 'what-did-they-say') ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
@ -61,10 +61,6 @@ class WhatDidTheySayAdminTest extends PHPUnit_Framework_TestCase {
|
|||
'change_languages' => 'reader'
|
||||
), $result['capabilities']);
|
||||
}
|
||||
|
||||
function testHandleUpdateLanguages() {
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: what-did-they-say 0.9.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-10-14 07:54-0400\n"
|
||||
"POT-Creation-Date: 2009-10-14 08:16-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -16,7 +16,7 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: what-did-they-say.php:207
|
||||
#: what-did-they-say.php:217
|
||||
msgid "Edit/Add Transcripts"
|
||||
msgstr ""
|
||||
|
||||
|
|
Loading…
Reference in New Issue