Empty commit

This commit is contained in:
Git 2013-04-12 08:01:01 +00:00
parent 25a85b09d2
commit 69c8524bff
3 changed files with 32 additions and 21 deletions

View File

@ -110,7 +110,8 @@
'forums_polls_moderate' => 'Can feature and close polls.', 'forums_polls_moderate' => 'Can feature and close polls.',
'project_team' => 'Is part of the project team.', 'project_team' => 'Is part of the project team.',
'torrents_edit_vanityhouse' => 'Can mark groups as part of Vanity House.', 'torrents_edit_vanityhouse' => 'Can mark groups as part of Vanity House.',
'artist_edit_vanityhouse' => 'Can mark artists as part of Vanity House.' 'artist_edit_vanityhouse' => 'Can mark artists as part of Vanity House.',
'site_tag_aliases_read' => 'Can view the list of tag aliases.'
); );
@ -163,6 +164,7 @@ function permissions_form(){ ?>
<? display_perm('site_collages_recover', 'Can recover \'deleted\' collages.'); ?> <? display_perm('site_collages_recover', 'Can recover \'deleted\' collages.'); ?>
<? display_perm('site_forums_double_post', 'Can double post in the forums.'); ?> <? display_perm('site_forums_double_post', 'Can double post in the forums.'); ?>
<? display_perm('project_team', 'Part of the project team.'); ?> <? display_perm('project_team', 'Part of the project team.'); ?>
<? display_perm('site_tag_aliases_read', 'Can view the list of tag aliases.'); ?>
</td> </td>
</tr> </tr>
</table> </table>

File diff suppressed because one or more lines are too long

View File

@ -1,29 +1,31 @@
<?php <?php
if (!check_perms('users_mod')) { error(403); if (!(check_perms('users_mod') || check_perms('site_tag_aliases_read'))) {
error(403);
} }
View::show_header('Tag Aliases'); View::show_header('Tag Aliases');
$orderby = ($_GET['order']) == "badtags" ? "BadTag" : "AliasTag"; $orderby = ($_GET['order']) == "badtags" ? "BadTag" : "AliasTag";
if (isset($_POST['newalias'])) { if (check_perms('users_mod')) {
$badtag = mysql_escape_string($_POST['badtag']); if (isset($_POST['newalias'])) {
$aliastag = mysql_escape_string($_POST['aliastag']); $badtag = mysql_escape_string($_POST['badtag']);
$aliastag = mysql_escape_string($_POST['aliastag']);
$DB -> query("INSERT INTO tag_aliases (BadTag, AliasTag) VALUES ('$badtag', '$aliastag')"); $DB -> query("INSERT INTO tag_aliases (BadTag, AliasTag) VALUES ('$badtag', '$aliastag')");
}
if (isset($_POST['changealias'])) {
$aliasid = $_POST['aliasid'];
$badtag = mysql_escape_string($_POST['badtag']);
$aliastag = mysql_escape_string($_POST['aliastag']);
if ($_POST['save']) {
$DB -> query("UPDATE tag_aliases SET BadTag = '$badtag', AliasTag = '$aliastag' WHERE ID = '$aliasid' ");
} }
if ($_POST['delete']) {
$DB -> query("DELETE FROM tag_aliases WHERE ID = '$aliasid'"); if (isset($_POST['changealias']) && is_number($_POST['aliasid'])) {
$aliasid = $_POST['aliasid'];
$badtag = mysql_escape_string($_POST['badtag']);
$aliastag = mysql_escape_string($_POST['aliastag']);
if ($_POST['save']) {
$DB -> query("UPDATE tag_aliases SET BadTag = '$badtag', AliasTag = '$aliastag' WHERE ID = '$aliasid' ");
}
if ($_POST['delete']) {
$DB -> query("DELETE FROM tag_aliases WHERE ID = '$aliasid'");
}
} }
} }
?> ?>
@ -38,7 +40,9 @@
<tr class="colhead"> <tr class="colhead">
<td>Proper tag</td> <td>Proper tag</td>
<td>Renamed from</td> <td>Renamed from</td>
<? if (check_perms('users_mod')) { ?>
<td>Submit</td> <td>Submit</td>
<? } ?>
</tr> </tr>
<tr/> <tr/>
<tr> <tr>
@ -50,12 +54,14 @@
<td> <td>
<input type="text" name="badtag" /> <input type="text" name="badtag" />
</td> </td>
<? if (check_perms('users_mod')) { ?>
<td> <td>
<input type="submit" value="Add Alias" /> <input type="submit" value="Add Alias" />
</td> </td>
<? } ?>
</form> </form>
</tr> </tr>
<? <?
$DB->query("SELECT ID,BadTag,AliasTag FROM tag_aliases ORDER BY " . $orderby); $DB->query("SELECT ID,BadTag,AliasTag FROM tag_aliases ORDER BY " . $orderby);
while (list($ID, $BadTag, $AliasTag) = $DB -> next_record()) { while (list($ID, $BadTag, $AliasTag) = $DB -> next_record()) {
?> ?>
@ -69,12 +75,15 @@
<td> <td>
<input type="text" name="badtag" value="<?=$BadTag?>" /> <input type="text" name="badtag" value="<?=$BadTag?>" />
</td> </td>
<? if (check_perms('users_mod')) { ?>
<td> <td>
<input type="submit" name="save" value="Save Alias" /> <input type="submit" name="save" value="Save Alias" />
<input type="submit" name="delete" value="Delete Alias" /> <input type="submit" name="delete" value="Delete Alias" />
</td> </td>
<? } ?>
</form> </form>
</tr> </tr>
<? }?> <?
} ?>
</table> </table>
<? View::show_footer(); ?> <? View::show_footer(); ?>