$query .= " ORDER BY users_lastseen.last_seen"; //echo "<b>SQL Query:</b><br>" . $query . ";<br><br>"; $res = pg_safe_exec($query); $bm_count = 0; echo "<table border=1 width=600 cellspacing=0 cellpadding=3 bgcolor=#" . $cTheme->table_bgcolor . ">\n"; echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><td><font color=#" . $cTheme->table_headtextcolor . "><b>User Name</b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b>Channel</b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b> </b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b>Since</b></font></td></tr>\n"; for ($i = 0; $i < pg_numrows($res); $i++) { $row = pg_fetch_object($res, $i); if (!((int) $row->flags & 1) && !((int) $row->flags & 2)) { // pgsql '&' operator fixed display (!) $bm_count++; $ts = time(); $ls = $row->last_seen; $t_val = $ts - $ls; $t_dur = abs($t_val); $the_duration = drake_duration($t_dur); echo "<tr><td><a href=\"../users.php?id=" . $row->user_id . "\" target=users>" . $row->user_name . "</a></td>" . "<td><a href=\"../channels.php?id=" . $row->channel_id . "\" target=channels>" . $row->channel_name . "</a></td>"; if (($row->flags & MIA_TAG_FLAG) == MIA_TAG_FLAG) { echo "<td><input type=button onClick=\"untag(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"UnTag\"></td>"; } else { echo "<td><input type=button onClick=\"tagreview(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"Tag as reviewed\"></td>"; } echo "<td>" . cs_time($row->last_seen) . " ({$the_duration})</td>" . "</tr>\n"; } } echo "</table><h3>\n"; if ($bm_count == 0) { echo "No More Missing Managers"; } if ($bm_count == 1) { echo $bm_count . " Missing Manager";
$level = pg_fetch_object($levels, $row); display_level($level, "N", $access, "N", $lastmod); } } // of else echo "</table>"; $bans = pg_safe_exec("SELECT channel_id,id,banmask,set_by,set_ts,level,expires,reason FROM bans WHERE expires>now()::abstime::int4 AND channel_id={$channel->id}"); if (pg_numrows($bans) != 0) { echo " <br><br>\n<TABLE WIDTH=100% cellspacing=0 cellpadding=2 BORDER=1 BGCOLOR=#" . $cTheme->table_bgcolor . ">\n<tr>\n <td colspan=6>\n <center><h2>Bans for this channel (" . (int) pg_numrows($bans) . " total)</h2>\n</center></Td>\n</tr>"; echo " <tr bgcolor=#" . $cTheme->table_headcolor . ">\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Banmask</td>\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Set by</td>\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Set at</td>\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Duration</td>\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Level</td>\n\t<td><font color=#" . $cTheme->table_headtextcolor . ">Reason</td>"; // if ($edit) { echo "<td><font color=#" . $cTheme->table_headtextcolor . ">Remove?</font>"; } echo "</td></tr>"; for ($row = 0; $row < pg_numrows($bans); $row++) { $ban = pg_fetch_object($bans, $row); echo " <tr><td>" . $ban->banmask . "</td><td>" . $ban->set_by . "</td>"; echo " <td>" . cs_time($ban->set_ts) . " [" . $ban->set_ts . "]</td><td>" . drake_duration($ban->expires - $ban->set_ts) . " [" . ($ban->expires - $ban->set_ts) / 3600 . " hour(s)]</td>"; echo " <td>" . $ban->level . "</td><td>" . htmlspecialchars($ban->reason) . "</td>"; // if ($edit) { echo "<td><input type=checkbox name=".$ban->id."_delete></td>"; } echo "</tr>"; } echo "</table>"; } // of if if ($admin > 0) { $type = $channel_events; echo "<br>"; $query = "SELECT channelid,ts,event,message FROM channellog WHERE channelid={$channel->id} ORDER BY ts DESC"; // echo "Q: $query<br>"; $logs = pg_safe_exec($query); if (pg_numrows($logs) == 0) { echo "There are no log messages for this channel\n<br><br>";
} else { $last_col = ""; } echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><td><font color=#" . $cTheme->table_headtextcolor . "><b>Username</b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b>Level</b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b>Last Access</b></font></td><td><font color=#" . $cTheme->table_headtextcolor . "><b>Expire</b></font></td>" . $last_col . "</tr>\n"; for ($i = 0; $i < pg_numrows($res); $i++) { $row = pg_fetch_object($res, $i); $bm_count++; $ENABLE_COOKIE_TABLE = 0; $unf = pg_safe_exec("SELECT user_name FROM users WHERE id='" . $row->user_id . "'"); $ooo = pg_fetch_object($unf, 0); echo "<tr>"; echo "<td><a href=\"../users.php?id=" . $row->user_id . "\" target=_blank>" . $ooo->user_name . "</a></td>"; $ENABLE_COOKIE_TABLE = 1; echo "<td>" . $row->is_admin . "</td>"; echo "<td>" . cs_time($row->expire - COOKIE_EXPIRE) . "</td>"; echo "<td>in " . drake_duration($row->expire - time()) . "</td>"; echo "<td>"; if (($admin > $row->is_admin || $admin == 1000) && $row->user_id != $user_id) { echo "<input type=button value=\"Force deauth\" onclick=\"if (confirm('This will LOGOUT user \\'" . $ooo->user_name . "\\'')) { location.href='fdeauth.php?cookie=" . $row->cookie . "&uid=" . $row->user_id . "'; }\">"; } else { echo " "; } echo "</td>"; echo "</tr>"; } echo "</table><h3>\n"; if ($bm_count == 0) { echo "No official is logged in"; } echo "</h3>"; ?>
$ress2 = pg_safe_exec("SELECT * FROM userlog WHERE user_id='{$pending->new_manager_id}' AND event='5'"); if (pg_numrows($ress) > 0 || pg_numrows($ress2) > 0 || trim($unf1->comment) != "") { echo "<tr bgcolor=#" . $cTheme->table_tr_enlighten3 . ">\n"; } else { echo "<tr bgcolor=#" . $cTheme->table_bgcolor . ">\n"; } echo "<td valign=top>" . cs_time($pending->expiration - 3600) . "</td>\n"; echo "<td valign=top><a href=\"../../channels.php?id={$pending->channel_id}\">{$unf1->name}</a> ({$pending->channel_id})</td>\n"; echo "<td valign=top align=center><a href=\"../../users.php?id={$pending->manager_id}\">{$unf2->user_name}</a> ({$pending->manager_id})</td>\n"; echo "<td valign=top align=center><a href=\"../../users.php?id={$pending->new_manager_id}\">{$unf3->user_name}</a> ({$pending->new_manager_id})</td>\n"; if ($pending->change_type == 0) { echo "<td valign=top><font color=#" . $cTheme->main_yes . "><b>Temporary</b></font></td>\n"; if ($pending->opt_duration - time() <= 0) { echo "<td valign=top>" . drake_duration(time() - $pending->opt_duration) . "</td>"; } else { echo "<td valign=top>" . drake_duration($pending->opt_duration - time()) . "</td>"; } } echo "</tr>\n"; echo "</table>\n"; echo "<br><br>\n"; echo "<input type=button value=\"NO, CANCEL !!\" onClick=\"history.go(-1);\">"; echo " "; echo "<input type=submit value=\"YES, REVERT IT\">\n"; echo "</form></body></html>\n\n"; die; } $toc = $pending->change_type; if (isset($queriez)) { unset($queriez); }
if ($level->flags & 0x1) { $aop_check = "CHECKED"; } if ($level->flags & 0x8) { $av_check = "CHECKED"; } echo "\n\t\t\t<TR>\n\t\t\t \t<TD VALIGN=top><FONT COLOR=black size=-1><b>AutoMode</B></TD>\n\t\t\t \t<TD><FONT COLOR=black><INPUT TYPE=radio NAME=new_automode VALUE=\"AutoOp\" {$aop_checked}>AutoOp\n\t\t\t\t\t<BR><INPUT TYPE=radio NAME=new_automode VALUE=\"AutoVoice\" {$av_checked}>AutoVoice\n\t\t\t\t\t<BR><INPUT TYPE=radio NAME=new_automode VALUE=\"None\">None\n\t\t\t\t</TD>\n\t\t\t</TR>\n\t\t\t"; } if ($access > $level->access && $access >= $level_modinfo || $admin >= $level_modinfo) { echo "\n\t\t\t <TR>\n\t\t\t \t<TD><FONT COLOR=black size=-1><b>Set Suspend</b></TD>\n\t\t\t \t<TD><INPUT TYPE=\"text\" NAME=\"new_suspend\" VALUE=\"{$level->suspend}\"></TD></TR>\n\t\t\t \t"; } if ($level->suspend_expires > time()) { $expire = $level->suspend_expires; $now = time(); $duration = $expire - $now; echo "\n\t\t<TR>\n\t\t\t<td> </td><td bgcolor=red><FONT COLOR=white size=-1><EM><b>Current Suspend by " . $level->suspend_by . " expires in " . drake_duration($duration) . "</TD></TR>"; } // TODO show last modif echo "\n\t\t\t<TR>\n\t\t\t\t<TD><FONT COLOR=black>Last Modificaton</TD>\n\t\t\t\t<TD><FONT COLOR=black>By " . $level->last_modified_by . " at " . cs_time($level->last_modif) . "</TD>\n\t\t\t</TR>\n\t\t\t"; } echo "\n\t<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=\"submit\" Value=\"Save Changes\"></TD></TR>\n\t</TABLE>"; } else { if ($action == "save") { echo "<PRE>\n\tAccess: {$new_access}\n\tAutoMode: {$new_automode}\n\tSuspend: {$new_suspend}\n</PRE>"; echo "<H1>Changes not committed to disk</h1>"; } else { echo "<H1>Error: Improperly accessed</H1>"; } } ?> </body></html>
$s_addy = "s"; } else { $s_addy = ""; } echo "<tr><td>"; echo "<table border=1 cellspacing=1 cellpadding=2 bgcolor=#" . $cTheme->table_bgcolor . ">"; echo "<tr bgcolor=#" . $cTheme->table_headcolor . ">"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Username</b></font></td>"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Since</b></font></td>"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Additionnal Info</b></font></td>"; echo "</tr>"; for ($x = 0; $x < pg_numrows($res); $x++) { $row = pg_fetch_object($res, $x); echo "<tr><td>"; echo "<a href=\"../users.php?id=" . $row->id . "\">" . $row->user_name . "</a></td>"; echo "<td>" . drake_duration(time() - $row->ts) . " ago</td>"; if ($admin < SHOW_IP_LEVEL) { echo "<td>" . htmlentities(remove_ip($row->message, 2)) . "</td>"; } else { echo "<td>" . htmlentities($row->message) . "</td>"; } echo "</tr>\n"; } echo "</table>"; echo "</td></tr>"; } } else { echo "<tr><td align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>Choosen date is invalid or period end is before start.</b></font></td></tr>\n"; } echo "</table>"; ?>
} else { echo "This user cannot apply to be a new manager yet.<br><br>\n"; } echo "<a href=\"javascript:history.go(-1);\">Go Back</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } // disallow channel changed permanently to be younger registered less than 90 days ago $blibli = pg_safe_exec("SELECT registered_ts FROM channels WHERE id='" . $channel_id . "'"); $buuu = pg_fetch_object($blibli, 0); $r_ts = $buuu->registered_ts; if ($r_ts + 86400 * 90 > time()) { echo "<h2>\n"; echo "The change request you have made will not be done.<br>We don't make Manager change on Newly Registered channel that is under 90 Days old.<br><br>\n"; echo "Yours was registered on : " . cs_time($r_ts) . " (" . drake_duration(time() - $r_ts) . " ago)<br>\n"; echo "<a href=\"javascript:history.go(-1);\">Go Back</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } $blabla = pg_safe_exec("SELECT * FROM channels,levels WHERE channels.id='{$channel_id}' AND levels.channel_id=channels.id AND levels.access=500"); if (pg_numrows($blabla) > 1) { echo "<h2>\n"; echo "This channel has multiple managers. Please /join " . SERVICE_CHANNEL . ", you need a special procedure.<br>\n"; echo "<a href=\"javascript:history.go(-1);\">Go Back</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } $change_type = 0;
echo "<tr><td align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>No suspended channels found for this period.</b></font></td></tr>"; } else { if (pg_numrows($res) > 1) { $s_addy = "s"; } else { $s_addy = ""; } echo "<tr><td>"; echo "<table border=1 cellspacing=1 cellpadding=2 bgcolor=#" . $cTheme->table_bgcolor . ">"; echo "<tr bgcolor=#" . $cTheme->table_headcolor . ">"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Username</b></font></td>"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Since</b></font></td>"; echo "<td><font color=#" . $cTheme->table_headtextcolor . "><b>Additionnal Info</b></font></td>"; echo "</tr>"; for ($x = 0; $x < pg_numrows($res); $x++) { $row = pg_fetch_object($res, $x); echo "<tr><td>"; echo "<a href=\"../channels.php?id=" . $row->id . "\">" . $row->name . "</a></td>"; echo "<td>" . drake_duration(time() - $row->last_updated) . " ago</td><td>n/a</td></tr>\n"; } echo "</table>"; echo "</td></tr>"; } } else { echo "<tr><td align=center><font color=#" . $cTheme->table_headcolor . " size=+1><b>Choosen date is invalid or period end is before start.</b></font></td></tr>\n"; } echo "</table>"; ?> </body> </html>