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("", "
".$message."
"); } $class_total = $sql->db_Select("userclass_classes", "*", "ORDER BY userclass_name", "nowhere"); $text = "
"; } $text .= " "; if(!isset($userclass_editclass)) { $userclass_editclass = e_UC_ADMIN; } $text .= " "; $text .= "
"; if ($class_total == "0") { $text .= UCSLAN_7; } else { $text .= "".UCSLAN_8.": ".UCSLAN_11."
".UCSLAN_12."
".UCSLAN_13."
".UCSLAN_24." ".r_userclass("userclass_editclass", $userclass_editclass, "off", "main,admin,classes,matchclass,public,nobody")."
"; if(isset($_POST['edit'])) { $text .= " "; } else { $text .= ""; } $text .= "
"; if(isset($_POST['edit'])) { $sql->db_Select("user", "user_id, user_name, user_class, user_login", "ORDER BY user_name", "no-where"); $c = 0; $d = 0; while ($row = $sql->db_Fetch()) { extract($row); if (check_class($userclass_id, $user_class)) { $in_userid[$c] = $user_id; $in_username[$c] = $user_name; $in_userlogin[$c] = $user_login ? "(".$user_login.")" : ""; $c++; } else { $out_userid[$d] = $user_id; $out_username[$d] = $user_name; $out_userlogin[$d] = $user_login ? "(".$user_login.")" : ""; $d++; } } $text .= "
".UCSLAN_16."
".UCSLAN_22."
".UCSLAN_23."


"; } $text .= "
"; // // Show a table of all userclasses and who can manage them // // lazy get list again $class_total = $sql->db_Select("userclass_classes", "*", "ORDER BY userclass_name", "nowhere"); $text .= "
\n"; if ($class_total == "0") { $text .= ""; } else { while ($row = $sql->db_Fetch()) { $rEditClass = $row['userclass_editclass']; if (check_class($rEditClass) || getperms("0")) { if(!isset($rEditClass)) { $rEditClass = e_UC_ADMIN; } $text .= "\n"; } } } $text .="
".UCSLAN_12." ".UCSLAN_24." ".UCSLAN_13."
".UCSLAN_7."
{$row['userclass_name']} ".r_userclass_name($rEditClass)." {$row['userclass_description']}
"; $ns->tablerender(UCSLAN_21, $text); require_once("footer.php"); function headerjs() { $script_js = "\n"; return $script_js; } ?>