[Customisation Database Commits] r995 - in /trunk/umil: language/en/umil.php umil.php
Nathan Guse
exreaction at phpbb.com
Sun Apr 4 23:17:54 BST 2010
Author: exreaction
Date: Sun Apr 4 23:17:54 2010
New Revision: 995
Log:
I was wrong, UMIL wasn't fully up-to-date besides the version number
Modified:
trunk/umil/language/en/umil.php
trunk/umil/umil.php
Modified: trunk/umil/language/en/umil.php
==============================================================================
*** trunk/umil/language/en/umil.php (original)
--- trunk/umil/language/en/umil.php Sun Apr 4 23:17:54 2010
***************
*** 4,10 ****
* @author Nathan Guse (EXreaction) http://lithiumstudios.org
* @author David Lewis (Highway of Life) highwayoflife at gmail.com
* @package umil
! * @version $Id: umil.php 149 2009-06-16 00:58:51Z exreaction $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
--- 4,10 ----
* @author Nathan Guse (EXreaction) http://lithiumstudios.org
* @author David Lewis (Highway of Life) highwayoflife at gmail.com
* @package umil
! * @version $Id: umil.php 207 2010-03-14 16:27:00Z exreaction $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
***************
*** 84,95 ****
'PERMISSION_ALREADY_EXISTS' => 'ERROR: Permission option %s already exists.',
'PERMISSION_NOT_EXIST' => 'ERROR: Permission option %s does not exist.',
'PERMISSION_REMOVE' => 'Removing permission option: %s',
'PERMISSION_SET_GROUP' => 'Setting permissions for the %s group.',
'PERMISSION_SET_ROLE' => 'Setting permissions for the %s role.',
'PERMISSION_UNSET_GROUP' => 'Unsetting permissions for the %s group.',
'PERMISSION_UNSET_ROLE' => 'Unsetting permissions for the %s role.',
! 'ROLE_NOT_EXIST' => 'Role does not exist',
'SUCCESS' => 'Success',
--- 84,99 ----
'PERMISSION_ALREADY_EXISTS' => 'ERROR: Permission option %s already exists.',
'PERMISSION_NOT_EXIST' => 'ERROR: Permission option %s does not exist.',
'PERMISSION_REMOVE' => 'Removing permission option: %s',
+ 'PERMISSION_ROLE_ADD' => 'Adding new permission role: %s',
+ 'PERMISSION_ROLE_UPDATE' => 'Updating permission role: %s',
+ 'PERMISSION_ROLE_REMOVE' => 'Removing permission role: %s',
'PERMISSION_SET_GROUP' => 'Setting permissions for the %s group.',
'PERMISSION_SET_ROLE' => 'Setting permissions for the %s role.',
'PERMISSION_UNSET_GROUP' => 'Unsetting permissions for the %s group.',
'PERMISSION_UNSET_ROLE' => 'Unsetting permissions for the %s role.',
! 'ROLE_ALREADY_EXISTS' => 'Permission role already exists.',
! 'ROLE_NOT_EXIST' => 'Permission role does not exist',
'SUCCESS' => 'Success',
Modified: trunk/umil/umil.php
==============================================================================
*** trunk/umil/umil.php (original)
--- trunk/umil/umil.php Sun Apr 4 23:17:54 2010
***************
*** 4,10 ****
* @author Nathan Guse (EXreaction) http://lithiumstudios.org
* @author David Lewis (Highway of Life) highwayoflife at gmail.com
* @package umil
! * @version $Id: umil.php 199 2010-03-04 23:48:31Z exreaction $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
--- 4,10 ----
* @author Nathan Guse (EXreaction) http://lithiumstudios.org
* @author David Lewis (Highway of Life) highwayoflife at gmail.com
* @package umil
! * @version $Id: umil.php 213 2010-04-01 20:15:31Z exreaction $
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
***************
*** 1685,1690 ****
--- 1685,1692 ----
return;
}
+ $this->umil_start('PERMISSION_ROLE_ADD', $role_name);
+
$sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . '
WHERE role_name = \'' . $this->db->sql_escape($role_name) . '\'';
$this->db->sql_query($sql);
***************
*** 1692,1698 ****
if ($role_id)
{
! return;
}
$sql = 'SELECT MAX(role_order) AS max FROM ' . ACL_ROLES_TABLE . '
--- 1694,1700 ----
if ($role_id)
{
! return $this->umil_end('ROLE_ALREADY_EXISTS', $old_role_name);
}
$sql = 'SELECT MAX(role_order) AS max FROM ' . ACL_ROLES_TABLE . '
***************
*** 1710,1715 ****
--- 1712,1719 ----
$sql = 'INSERT INTO ' . ACL_ROLES_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
+
+ return $this->umil_end();
}
/**
***************
*** 1726,1735 ****
--- 1730,1753 ----
return;
}
+ $this->umil_start('PERMISSION_ROLE_UPDATE', $old_role_name);
+
+ $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . '
+ WHERE role_name = \'' . $this->db->sql_escape($old_role_name) . '\'';
+ $this->db->sql_query($sql);
+ $role_id = $this->db->sql_fetchfield('role_id');
+
+ if (!$role_id)
+ {
+ return $this->umil_end('ROLE_NOT_EXIST', $old_role_name);
+ }
+
$sql = 'UPDATE ' . ACL_ROLES_TABLE . '
SET role_name = \'' . $this->db->sql_escape($new_role_name) . '\'
WHERE role_name = \'' . $this->db->sql_escape($old_role_name) . '\'';
$this->db->sql_query($sql);
+
+ return $this->umil_end();
}
/**
***************
*** 1747,1752 ****
--- 1765,1772 ----
return;
}
+ $this->umil_start('PERMISSION_ROLE_REMOVE', $role_name);
+
$sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . '
WHERE role_name = \'' . $this->db->sql_escape($role_name) . '\'';
$this->db->sql_query($sql);
***************
*** 1754,1760 ****
if (!$role_id)
{
! return;
}
$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
--- 1774,1780 ----
if (!$role_id)
{
! return $this->umil_end('ROLE_NOT_EXIST', $role_name);
}
$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
***************
*** 1766,1771 ****
--- 1786,1793 ----
$this->db->sql_query($sql);
$auth->acl_clear_prefetch();
+
+ return $this->umil_end();
}
/**
***************
*** 2969,2976 ****
{
global $table_prefix;
! // Replacing phpbb_ with the $table_prefix, but, just in case we have a different table prefix with phpbb_ in it (say, like phpbb_3), we are replacing the table prefix with phpbb_ first to make sure we do not have issues.
! $table_name = str_replace('phpbb_', $table_prefix, str_replace($table_prefix, 'phpbb_', $table_name));
}
}
--- 2991,2997 ----
{
global $table_prefix;
! $table_name = preg_replace('#phpbb_#i', $table_prefix, $table_name);
}
}
More information about the customisationdb-commits
mailing list