daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Oct 26th, 2010 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.  * @package AJAX_Chat
  4.  * @author Sebastian Tschan
  5.  * @copyright (c) Sebastian Tschan
  6.  * @license GNU Affero General Public License
  7.  * @link https://blueimp.net/ajax/
  8.  */
  9.  
  10. // List containing the registered chat users:
  11. $users = array();
  12.  
  13. // Default guest user (don't delete this one):
  14. //$users[0] = array();
  15. //$users[0]['userRole'] = AJAX_CHAT_GUEST;
  16. //$users[0]['userName'] = null;
  17. //$users[0]['password'] = null;
  18. //$users[0]['channels'] = array(0);
  19.  
  20.  
  21. $con = mysql_connect("localhost", "dannyf_admin", "mypasswordishere");
  22. mysql_select_db("dannyf_test", $con);
  23. $query = mysql_query("SELECT * FROM ajax_chat_users");
  24.  
  25. while($row = mysql_fetch_array($query)){
  26.  
  27. $uid = $row['uid'];
  28. $username = $row['name'];
  29.  
  30. if($row['level'] == 'admin'){
  31. // Sample admin user:
  32. $users[$uid] = array();
  33. $users[$uid]['userRole'] = AJAX_CHAT_ADMIN;
  34. $users[$uid]['userName'] = '$username';
  35. $users[$uid]['password'] = 'admin';
  36. $users[$uid]['channels'] = array(0,1);
  37. }
  38.  
  39.  
  40. if($row['level'] == 'mod'){
  41. // Sample admin user:
  42. $users[$uid] = array();
  43. $users[$uid]['userRole'] = AJAX_CHAT_MODERATOR;
  44. $users[$uid]['userName'] = '$username';
  45. $users[$uid]['password'] = 'admin';
  46. $users[$uid]['channels'] = array(0,1);
  47. }
  48.  
  49. if($row['level'] == 'user'){
  50. // Sample admin user:
  51. $users[$uid] = array();
  52. $users[$uid]['userRole'] = AJAX_CHAT_USER;
  53. $users[$uid]['userName'] = '$username';
  54. $users[$uid]['password'] = 'admin';
  55. $users[$uid]['channels'] = array(0,1);
  56. }
  57.  
  58. }
  59. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top