1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Creation of userclasses works again

This commit is contained in:
mcfly
2008-12-10 13:27:09 +00:00
parent f1340bd2b9
commit ac8a5bac22

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
| $Revision: 1.55 $ | $Revision: 1.56 $
| $Date: 2008-12-07 21:41:04 $ | $Date: 2008-12-10 13:27:09 $
| $Author: e107steved $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -304,8 +304,6 @@ class e107plugin
function manage_userclass($action, $class_name, $class_description) function manage_userclass($action, $class_name, $class_description)
{ {
global $sql, $tp; global $sql, $tp;
$class_name = $tp->toDB($class_name, true);
$class_description = $tp->toDB($class_description, true);
if ($action == 'add') if ($action == 'add')
{ {
$i = 1; $i = 1;
@@ -315,7 +313,13 @@ class e107plugin
} }
if ($i < e_UC_READONLY) if ($i < e_UC_READONLY)
{ {
return $sql->db_Insert('userclass_classes', "{$i},'".strip_tags(strtoupper($class_name))."', '{$class_description}' ,".e_UC_PUBLIC); $tmp = array();
$tmp['userclass_id'] = $i;
$tmp['userclass_name'] = strip_tags(strtoupper($class_name));
$tmp['userclass_description'] = $class_description;
$tmp['_FIELD_TYPES']['userclass_id'] = 'int';
$tmp['_FIELD_TYPES']['_DEFAULT'] = 'todb';
return $sql->db_Insert('userclass_classes', $tmp, true);
} }
else else
{ {
@@ -1546,7 +1550,7 @@ class e107plugin
require_once(e_HANDLER.'xml_class.php'); require_once(e_HANDLER.'xml_class.php');
$xml = new xmlClass; $xml = new xmlClass;
$this->plug_vars = $xml->loadXMLfile($path.'plugin.xml', true, true); $this->plug_vars = $xml->loadXMLfile($path.'plugin.xml', true, true);
if ($this->plug_vars === FALSE) if ($this->plug_vars === FALSE)
{ {
echo "Error reading {$path}/plugin.xml<br />"; echo "Error reading {$path}/plugin.xml<br />";
return FALSE; return FALSE;