Changeset 374 for minimanager/command.php
- Timestamp:
- Sep 11, 2008, 9:10:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/command.php
r178 r374 10 10 11 11 include("header.php"); 12 valid_login( 0);12 valid_login($action_permission['read']); 13 13 14 14 //####################################################################################### … … 22 22 1 => array ('level1',''), 23 23 2 => array ('level2',''), 24 3 => array ('level3','') 24 3 => array ('level3',''), 25 4 => array ('level4',''), 26 5 => array ('level5','') 25 27 ); 26 28 … … 32 34 while ($data = $sql->fetch_row($query)){ 33 35 $tmp_output = "<tr>"; 34 $tmp_output .= ($user_lvl > 2) ? "<td><input type=\"checkbox\" name=\"check[$data[0]]\" value=\"$data[2]\" /></td>" : "<td></td>";35 $tmp_output .= "<td align=\" right\">.$data[0]</td>";36 $tmp_output .= ($user_lvl >= 4) ? "<td><input type=\"checkbox\" name=\"check[$data[0]]\" value=\"$data[2]\" /></td>" : "<td></td>"; 37 $tmp_output .= "<td align=\"left\">.$data[0]</td>"; 36 38 $comm = explode("\r\n",$data[1],2); 37 39 $syntax = ereg_replace("[a-zA-Z ]+:* *\.".$data[0]." *", "", str_replace("/", "<br />",$comm[0])); … … 51 53 52 54 for ($i=0; $i<=$user_lvl; $i++){ 53 if ($i <= 3) {55 if ($i <= 5) { 54 56 $output .= "<fieldset class=\"full_frame\"> 55 57 <legend>". … … 66 68 </tr>" . $levels[$i][1]; 67 69 68 if ($user_lvl > 2) {70 if ($user_lvl >= 5) { 69 71 $output .= "</table><br /><table class=\"hidden\" style=\"width: 720px;\"><td>"; 70 72 makebutton($lang_command['change_level'], "javascript:do_submit()",280); … … 84 86 function update_commands(){ 85 87 global $lang_global, $lang_command, $output, $user_lvl; 86 valid_login(3);88 if ($user_lvl < 4) redirect("command.php?error=2"); 87 89 88 90 if(isset($_GET['check'])) $check = $_GET['check']; … … 94 96 <table class=\"lined\" style=\"width: 720px;\"> 95 97 <tr> 96 <th width=\"20%\"></th> 97 <th width=\"20%\">{$lang_command['level0']}</th> 98 <th width=\"20%\">{$lang_command['level1']}</th> 99 <th width=\"20%\">{$lang_command['level2']}</th> 100 <th width=\"20%\">{$lang_command['level3']}</th> 98 <th width=\"22%\"></th> 99 <th width=\"13%\">{$lang_command['level0']}</th> 100 <th width=\"13%\">{$lang_command['level1']}</th> 101 <th width=\"13%\">{$lang_command['level2']}</th> 102 <th width=\"13%\">{$lang_command['level3']}</th> 103 <th width=\"13%\">{$lang_command['level4']}</th> 104 <th width=\"13%\">{$lang_command['level5']}</th> 101 105 </tr>"; 102 106 … … 117 121 if ($check[$commands[$i]]==3) $output .= "checked=\"checked\""; 118 122 $output .= " ></td> 123 <td> <input type=\"radio\" name=\"change[".$commands[$i]."]\" value=\"4\""; 124 if ($check[$commands[$i]]==3) $output .= "checked=\"checked\""; 125 $output .= " ></td> 126 <td> <input type=\"radio\" name=\"change[".$commands[$i]."]\" value=\"5\""; 127 if ($check[$commands[$i]]==3) $output .= "checked=\"checked\""; 128 $output .= " ></td> 119 129 </tr>"; 120 130 } … … 130 140 //####################################################################################################### 131 141 function doupdate_commands() { 132 global $lang_global, $output, $mangos_db, $realm_id; 133 134 valid_login(3); 142 global $lang_global, $output, $mangos_db, $realm_id, $user_lvl; 143 if ($user_lvl < 4) redirect("command.php?error=2"); 135 144 136 145 $sql = new SQL; … … 143 152 // Quick sanity check 144 153 for ($i=0; $i<count($change); $i++) { 145 if (!in_array($change[$commands[$i]],array(0,1,2,3 )))154 if (!in_array($change[$commands[$i]],array(0,1,2,3,4,5))) 146 155 redirect("command.php?error=1"); 147 156 } … … 165 174 $output .= "<h1><font class=\"error\">{$lang_global['empty_fields']}</font></h1>"; 166 175 break; 176 case 2: 177 $output .= "<h1><font class=\"error\">{$lang_global['err_no_permission']}</font></h1>"; 178 break; 167 179 default: //no error 168 180 $output .= "<h1>{$lang_command['command_list']}</h1>";
Note:
See TracChangeset
for help on using the changeset viewer.