mirror of
https://github.com/e107inc/e107.git
synced 2025-05-01 17:57:56 +02:00
Allow lots more userclasses. Fix table update part of update routine
This commit is contained in:
parent
7c395b8c16
commit
595291f1d0
@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||
| $Revision: 1.16 $
|
||||
| $Date: 2008-12-17 20:03:53 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.17 $
|
||||
| $Date: 2009-06-29 21:26:58 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
header("location:../index.php");
|
||||
@ -546,7 +546,7 @@ CREATE TABLE user (
|
||||
# Table structure for table `userclass_classes`
|
||||
#
|
||||
CREATE TABLE userclass_classes (
|
||||
userclass_id tinyint(3) unsigned NOT NULL default '0',
|
||||
userclass_id smallint(5) unsigned NOT NULL default '0',
|
||||
userclass_name varchar(100) NOT NULL default '',
|
||||
userclass_description varchar(250) NOT NULL default '',
|
||||
userclass_editclass tinyint(3) unsigned NOT NULL default '0',
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||
| $Revision: 1.37 $
|
||||
| $Date: 2009-05-24 15:34:36 $
|
||||
| $Revision: 1.38 $
|
||||
| $Date: 2009-06-29 21:26:58 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -607,7 +607,7 @@ function update_706_to_800($type='')
|
||||
|
||||
if ((($actual_defs = $db_parser->get_current_table($ct)) === FALSE) || !is_array($actual_defs)) // Adds current default prefix
|
||||
{
|
||||
// echo "Couldn't get table structure: {$ct}<br />";
|
||||
echo "Couldn't get table structure: {$ct}<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -916,10 +916,10 @@ function addIndexToTable($target, $indexSpec, $just_check, &$updateMessages, $op
|
||||
|
||||
function catch_error(&$target)
|
||||
{
|
||||
if ($target->getLastErrorText() != '' && E107_DEBUG_LEVEL != 0)
|
||||
if ($target->mySQLlastErrText() != '' && E107_DEBUG_LEVEL != 0)
|
||||
{
|
||||
$tmp2 = debug_backtrace();
|
||||
$tmp = $target->getLastErrorText();
|
||||
$tmp = $target->mySQLlastErrText();
|
||||
echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />";
|
||||
}
|
||||
return;
|
||||
|
@ -11,9 +11,9 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2008-12-20 00:55:29 $
|
||||
| $Author: mcfly_e107 $
|
||||
| $Revision: 1.8 $
|
||||
| $Date: 2009-06-29 21:26:58 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@ -45,7 +45,7 @@ class db_table_admin
|
||||
$sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1');
|
||||
$qry = 'SHOW CREATE TABLE `'.$prefix.$table_name."`";
|
||||
if (!($z = $sql->db_Select_gen($qry))) { return FALSE; }
|
||||
$row = $sql->db_Fetch();
|
||||
$row = $sql->db_Fetch(MYSQL_NUM);
|
||||
$tmp = str_replace("`", "", stripslashes($row[1])).';'; // Add semicolon to work with our parser
|
||||
$count = preg_match_all("#CREATE\s+?TABLE\s+?`{0,1}({$prefix}{$table_name})`{0,1}\s+?\((.*?)\)\s+?(?:TYPE|ENGINE)\s*\=\s*(.*?);#is",$tmp,$matches,PREG_SET_ORDER);
|
||||
if ($count === FALSE) { return "Error occurred";}
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
|
||||
| $Revision: 1.32 $
|
||||
| $Date: 2009-04-30 20:10:10 $
|
||||
| $Revision: 1.33 $
|
||||
| $Date: 2009-06-29 21:26:58 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -43,6 +43,7 @@ define('e_UC_ADMINMOD',249);
|
||||
define('e_UC_MODS',248);
|
||||
define('e_UC_NEWUSER',247); // Users in 'probationary' period
|
||||
define('e_UC_SPECIAL_BASE',245); // Assign class IDs 245 and above for fixed/special purposes
|
||||
define('e_UC_SPECIAL_END',255); // Highest 'special' class
|
||||
|
||||
define('UC_CLASS_ICON_DIR','userclasses/'); // Directory for userclass icons
|
||||
define('UC_ICON_DIR',e_IMAGE.'generic/'); // Directory for the icons used in the admin tree displays
|
||||
@ -1122,6 +1123,12 @@ class user_class_admin extends user_class
|
||||
{
|
||||
if (!isset($this->class_tree[$i])) return $i;
|
||||
}
|
||||
// Big system!! Assign a class in the 0.8-only block above 255
|
||||
for ($i = e_UC_SPECIAL_END+1; ($i < 32767); $i++)
|
||||
{
|
||||
if (!isset($this->class_tree[$i])) return $i;
|
||||
}
|
||||
|
||||
return FALSE; // Just in case all classes assigned!
|
||||
}
|
||||
|
||||
@ -1233,10 +1240,10 @@ class user_class_admin extends user_class
|
||||
function checkAdminInfo(&$data, $id)
|
||||
{
|
||||
$ret = TRUE;
|
||||
if ($id < e_UC_SPECIAL_BASE) return TRUE;
|
||||
if (($id < e_UC_SPECIAL_BASE) || ($id > e_UC_SPECIAL_END)) return TRUE;
|
||||
if (isset($data['userclass_parent']))
|
||||
{
|
||||
if ($data['userclass_parent'] < e_UC_SPECIAL_BASE)
|
||||
if (($data['userclass_parent'] < e_UC_SPECIAL_BASE) || ($data['userclass_parent'] > e_UC_SPECIAL_END))
|
||||
{
|
||||
$data['userclass_parent'] = e_UC_NOBODY;
|
||||
$ret = FALSE;
|
||||
@ -1252,7 +1259,7 @@ class user_class_admin extends user_class
|
||||
$ret = FALSE;
|
||||
}
|
||||
}
|
||||
elseif ($data['userclass_editclass'] < e_UC_SPECIAL_BASE)
|
||||
elseif (($data['userclass_editclass'] < e_UC_SPECIAL_BASE) || ($data['userclass_editclass'] > e_UC_SPECIAL_END))
|
||||
{
|
||||
$data['userclass_editclass'] = e_UC_MAINADMIN;
|
||||
$ret = FALSE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user