Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: AJAX chat help

  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    3
    Thanked 0 Times in 0 Posts

    AJAX chat help

    I just uploaded ajax chat to my website and working. Just trying to set some features such as admin and password.

    The answer is http://sourceforge.net/apps/mediawik...ors_and_admins, but I'm blunt right now.

    So after I added it, it should look like this right?

    <?php
    /*
    * @package AJAX_Chat
    * @author Sebastian Tschan
    * @copyright (c) Sebastian Tschan
    * @license GNU Affero General Public License
    * @link https://blueimp.net/ajax/
    */

    class CustomAJAXChat extends AJAXChat {

    // Returns an associative array containing userName, userID and userRole
    // Returns null if login is invalid
    function getValidLoginUserData() {

    $customUsers = $this->getCustomUsers();

    if($this->getRequestVar('password')) {
    // Check if we have a valid registered user:

    $userName = $this->getRequestVar('userName');
    $userName = $this->convertEncoding($userName, $this->getConfig('contentEncoding'), $this->getConfig('sourceEncoding'));

    $password = $this->getRequestVar('password');
    $password = $this->convertEncoding($password, $this->getConfig('contentEncoding'), $this->getConfig('sourceEncoding'));

    foreach($customUsers as $key=>$value) {
    if(($value['userName'] == $userName) && ($value['password'] == $password)) {
    $userData = array();
    $userData['userID'] = MyUserID;
    $userData['userName'] = $this->trimUserName($value['userName']);
    $userData['userRole'] = AJAX_CHAT_MODERATOR;
    return $userData;

  • #2
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Anyone here can help me?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •