Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $channels = array("26" => "Northern Coalition",
- "22" => "Best Friends Forever",
- "20" => "Burning Napalm",
- "17" => "D00M",
- "16" => "Digital Fury Corporation",
- "24" => "Fleet Commanders",
- "21" => "Infamous Mob",
- "25" => "Leadership",
- "18" => "Rionnag Alba",
- "19" => "Spartan Industries",
- "23" => "The Wretched",
- "27" => "Super Capitals",
- "28" => "Capitals");
- //Select groups that the user is in
- $grp = "SELECT id_group, additional_groups FROM smf_members WHERE (member_name = '$username' OR real_name = '$username')";
- $grp2 = mysql_query($grp);
- $grp3 = mysql_fetch_assoc($grp2);
- $idgrp = $grp3['id_group'];
- $adgrp = $grp3['additional_groups'];
- $groups = array($idgrp);
- $adgrp = explode(",", $adgrp);
- foreach ($adgrp as $group){
- if ($group == "null")
- continue;
- $groups[] = $group;
- }
- $groups = array_unique($groups);
- foreach ($channels as $id => $channel){
- $check = "SELECT * FROM ejabberdusers WHERE username = '$username' AND password = '$password'";
- $check2 = mysql_query($check);
- $check3 = mysql_fetch_assoc($check2);
- $chan = $check3['group'];
- if ($chan != $channel){
- $add = "/sbin/ejabberdctl srg-user-add ".$username2." ".$domain." \\\"".$channel."\\\" ".$domain."";
- if(exec($add)) { $this->logg("FAILED at adding ".$username2." to ".$channel.""); } else { $this->logg("SUCCESS at adding ".$username2." to ".$channel.""); }
- } else {
- $this->logg("".$username2." is already added to the ".$channel." channel");
- }
- //Mark user as registered, and insert info about him/her to the database
- $add = "INSERT INTO ejabberdusers (`username`,`password`,`added`,`group`) VALUES ('".$username2."', '".$password."', '0', '".$channel."')";
- mysql_query($add);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement