Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc addsupport {nick uhost hand chan text} {
- global siteurl botpass bothash
- set mod $nick
- set whom [lindex $text 0]
- set supportfor [lrange $text 1 end]
- set toggle [lrange $text 1 end]
- if {$whom!=""} {
- set data [::http::geturl $siteurl?addsupport&supportfor=$supportfor&toggle=$toggle&whom=$whom&mod=$mod&pass=$botpass&hash=$bothash]
- foreach line [split [::http::data $data] \n] {
- if {$line != ""} {
- putquick "PRIVMSG $chan :\0032$line\003"
- }
- }
- ::http::cleanup $data
- } else {
- putquick "PRIVMSG $chan : format is: !addsupport <nick> <support for>"
- }
- }
- elseif(isset($_GET['addsupport'])){
- if((isset($_GET['toggle']) && $_GET['toggle'] == "yes") || (isset($_GET['toggle']) && $_GET['toggle'] == "no")){
- $whom = (isset($_GET['whom'])?sqlesc($_GET['whom']):'');
- $who = (isset($_GET['whom'])?htmlspecialchars($_GET['whom']):'');
- $supportfor = (isset($_GET['supportfor'])?sqlesc($_GET['supportfor']):'');
- $res = sql_query("SELECT id, support, supportfor FROM users WHERE username = $whom AND class < $modclass LIMIT 1") or sqlerr(__FILE__, __LINE__);
- $support = mysql_fetch_assoc($res);
- if($support < 1)
- echo $who . " - No such user or is staff, please try again.";
- else{
- $newsupp = (isset($support['support'])?htmlspecialchars($support['support']):'');
- $modd = (isset($_GET['mod'])?htmlspecialchars($_GET['mod']):'');
- $supportfors = (isset($_GET['supportfor'])?htmlspecialchars($_GET['supportfor']):'');
- $toggle = (isset($_GET['toggle'])?htmlspecialchars($_GET['toggle']):'');
- $modcomment = sqlesc(get_date( time(), 'DATE', 1 ) . " IRC: " . $who . "s support changed from: " . $newsupp . " to ". $toggle . " by " . $modd . "\n");
- sql_query("UPDATE users SET support = '$toggle', supportfor ='$supportfors', modcomment = CONCAT($modcomment,modcomment) WHERE username = $whom") or sqlerr(__FILE__, __LINE__);
- $mc1->delete_value('MyUser_'.$whom);
- echo $who . 's support changed from ' . $newsupp . ' to '. $toggle . ', added to First line support to cover '.$supportfors.' by ' . $modd;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement