aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Atkinson <thefinn@users.sourceforge.net>2001-12-17 10:03:33 +0000
committerJames Atkinson <thefinn@users.sourceforge.net>2001-12-17 10:03:33 +0000
commit4a6c692484074114cabf317b4c12dc70dce28f40 (patch)
treee1d78ecb08ed0c7493d08fe1781fb54523a33e8f
parent4f2db0f4145efafd693eb74cdaecd125d4678854 (diff)
downloadforums-4a6c692484074114cabf317b4c12dc70dce28f40.tar
forums-4a6c692484074114cabf317b4c12dc70dce28f40.tar.gz
forums-4a6c692484074114cabf317b4c12dc70dce28f40.tar.bz2
forums-4a6c692484074114cabf317b4c12dc70dce28f40.tar.xz
forums-4a6c692484074114cabf317b4c12dc70dce28f40.zip
Fixed bug #492183, added checking on theme name when creating new theme.
git-svn-id: file:///svn/phpbb/trunk@1620 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/admin/admin_styles.php16
-rw-r--r--phpBB/language/lang_english/lang_admin.php1
2 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/admin/admin_styles.php b/phpBB/admin/admin_styles.php
index df65195d3c..9d311a09ef 100644
--- a/phpBB/admin/admin_styles.php
+++ b/phpBB/admin/admin_styles.php
@@ -69,6 +69,7 @@ switch( $mode )
if( isset($install_to) )
{
+
include($phpbb_root_dir . "templates/" . $install_to . "/theme_info.cfg");
$template_name = $$install_to;
@@ -374,6 +375,21 @@ switch( $mode )
}
else
{
+ //
+ // First, check if we already have a style by this name
+ //
+ $sql = "SELECT themes_id FROM " . THEMES_TABLE . " WHERE style_name = '" . $updated['style_name'] . "'";
+
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Could not query themes table", "Error", __LINE__, __FILE__, $sql);
+ }
+
+ if($db->sql_numrows($result))
+ {
+ message_die(GENERAL_ERROR, $lang['Style_exists'], $lang['Error']);
+ }
+
while(list($key, $val) = each($updated))
{
$field_names[] = $key;
diff --git a/phpBB/language/lang_english/lang_admin.php b/phpBB/language/lang_english/lang_admin.php
index 47bca32209..39ef1cb32c 100644
--- a/phpBB/language/lang_english/lang_admin.php
+++ b/phpBB/language/lang_english/lang_admin.php
@@ -579,6 +579,7 @@ $lang['Download_theme_cfg'] = "The exporter could not write the theme informatio
$lang['No_themes'] = "The template you selected has no themes attached to it. To create a new theme click the Create New link on the left hand panel";
$lang['No_template_dir'] = "Could not open the template directory. It may be unreadable by the webserver or may not exist";
$lang['Cannot_remove_style'] = "You cannot remove the style selected since it is currently the forum default. Please change the default style and try again.";
+$lang['Style_exists'] = "The style name to selected already exists, please go back and choose a different name.";
$lang['Click_return_styleadmin'] = "Click %sHere%s to return to Style Administration";