db_Select('userclass_classes', '*', "userclass_id = {$class_id}")) { header("location:".SITEURL); exit; } $row = $sql->db_Fetch(); if (!getperms('0') && !check_class($row['userclass_editclass'])) { header("location:".SITEURL); exit; } } if (strstr(e_QUERY, 'clear')) { $tmp = explode('.', e_QUERY); $class_id = $tmp[1]; check_allowed($class_id); if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')")) { while ($row = $sql->db_Fetch()) { $uidList[$row['user_id']] = $row['user_class']; } $uclass->class_remove($class_id, $uidList); $message = UCSLAN_1; } } elseif(e_QUERY) { $tmp2 = explode('-', e_QUERY); $class_id = $tmp2[0]; check_allowed($class_id); $message = UCSLAN_2; if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')")) { while ($row = $sql->db_Fetch()) { $uidList[$row['user_id']] = $row['user_class']; } $uclass->class_remove($class_id, $uidList); } unset($uidList); if ($sql->db_Select('user', 'user_id, user_class', "user_id IN({$tmp2[1]})")) { while ($row = $sql->db_Fetch()) { $uidList[$row['user_id']] = $row['user_class']; } $uclass->class_add($class_id, $uidList); } } if (isset($_POST['delete'])) { $class_id = $_POST['existing']; check_allowed($class_id); if ($_POST['confirm']) { $sql->db_Delete('userclass_classes', "userclass_id='".$_POST['existing']."' "); if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')")) { while ($row = $sql->db_Fetch()) { $uidList[$row['user_id']] = $row['user_class']; } $uclass->class_remove($class_id, $uidList); } if (isset($pref['frontpage'][$class_id])) { unset($pref['frontpage'][$class_id]); save_prefs(); } $message = UCSLAN_3; } else { $message = UCSLAN_4; } } if(isset($_POST['edit'])) { check_allowed($_POST['existing']); $sql->db_Select('userclass_classes', '*', "userclass_id='".$_POST['existing']."' "); $row = $sql->db_Fetch(); extract($row); } if (isset($_POST['updateclass'])) { check_allowed($_POST['userclass_id']); $_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']); $_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']); $sql->db_Update('userclass_classes', "userclass_editclass={$_POST['userclass_editclass']}, userclass_name='".$_POST['userclass_name']."', userclass_description='".$_POST['userclass_description']."' WHERE userclass_id='".$_POST['userclass_id']."' "); $message = UCSLAN_5; } if (isset($_POST['createclass'])) { if($_POST['userclass_name']) { $_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']); $_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']); if (getperms("0") || check_class($_POST['userclass_editclass']) && $_POST['userclass_editclass']) { $editclass = $_POST['userclass_editclass']; $i = 1; while ($sql->db_Select('userclass_classes', '*', "userclass_id='".$i."' ") && $i < 255) { $i++; } if ($i < 255) { $sql->db_Insert("userclass_classes", $i.", '".strip_tags($_POST['userclass_name'])."', '".$_POST['userclass_description']."',{$editclass} "); } if (!isset($pref['frontpage'][$i])) { $pref['frontpage'][$i] = $pref['frontpage'][e_UC_GUEST]; save_prefs(); } $message = UCSLAN_6; } else { header("location:".SITEURL); exit; } } } if (isset($message)) { $ns->tablerender("", "