1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-02 04:24:56 +02:00

Merge remote-tracking branch 'remotes/imkingdavid/ticket/11253' into develop

# By David King
# Via David King
* remotes/imkingdavid/ticket/11253:
  [ticket/11253] Put AND clause in correct SQL query
  [ticket/11253] Fix a few things brought up in the PR
  [ticket/11253] Fix typo in constant
  [ticket/11253] Add migration to add auth check to UCP signature module
This commit is contained in:
Nathan Guse 2013-07-06 11:15:04 -05:00
commit 2d7a91ebd6

View File

@ -0,0 +1,51 @@
<?php
/**
*
* @package migration
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License v2
*
*/
class phpbb_db_migration_data_310_signature_module_auth extends phpbb_db_migration
{
public function effectively_installed()
{
$sql = 'SELECT module_auth
FROM ' . MODULES_TABLE . "
WHERE module_class = 'ucp'
AND module_basename = 'ucp_profile'
AND module_mode = 'signature'";
$result = $this->db->sql_query($sql);
$module_auth = $this->db_sql_fetchfield('module_auth');
$this->db->sql_freeresult($result);
return $module_auth === 'acl_u_sig' || $module_auth === false;
}
static public function depends_on()
{
return array('phpbb_db_migration_data_31x_dev');
}
public function update_data()
{
return array(
array('custom', array(
array($this, 'update_signature_module_auth'),
),
),
);
}
public function update_signature_module_auth()
{
$sql = 'UPDATE ' . MODULES_TABLE . "
SET module_auth = 'acl_u_sig'
WHERE module_class = 'ucp'
AND module_basename = 'ucp_profile'
AND module_mode = 'signature'
AND module_auth = ''";
$this->db->sql_query($sql);
}
}