1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 02:06:32 +02:00

- store sql_layer directly within the layer itself

- new method sql_multi_insert to circumvent db-specific hacks
(hopefully not introduced any parsing errors)


git-svn-id: file:///svn/phpbb/trunk@6497 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-10-14 14:56:46 +00:00
parent 46922674ea
commit 4afaca12dc
38 changed files with 198 additions and 465 deletions

View File

@@ -724,24 +724,7 @@ class auth_admin extends auth
}
}
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
$cache->destroy('acl_options');
$this->acl_clear_prefetch();
@@ -874,24 +857,7 @@ class auth_admin extends auth
}
}
if (sizeof($sql_ary))
{
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary));
}
break;
}
}
$db->sql_multi_insert($table, $sql_ary);
if ($clear_prefetch)
{
@@ -956,21 +922,8 @@ class auth_admin extends auth
WHERE role_id = ' . $role_id;
$db->sql_query($sql);
switch (SQL_LAYER)
{
case 'mysql':
case 'mysql4':
case 'mysqli':
$db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary));
break;
default:
foreach ($sql_ary as $ary)
{
$db->sql_query('INSERT INTO ' . ACL_ROLES_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
}
break;
}
// Now insert the new values
$db->sql_multi_insert(ACL_ROLES_DATA_TABLE, $sql_ary);
$this->acl_clear_prefetch();
}
@@ -1010,7 +963,7 @@ class auth_admin extends auth
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'";
$sql .= (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') ? " ESCAPE '\\'" : '';
$sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
$result = $db->sql_query($sql);