Esempio n. 1
0
    /**
     * Generates a page with awaiting visitors.
     *
     * @param Request $request
     * @return string Rendered page content
     */
    public function indexAction(Request $request)
    {
        $operator = $this->getOperator();

        // Operator becomes online as soon as he open "operator/users" page
        notify_operator_alive($operator['operatorid'], 0);
        $operator['istatus'] = 0;
        $this->getAuthenticationManager()->setOperator($operator);

        $_SESSION[SESSION_PREFIX . "operatorgroups"] = get_operator_groups_list($operator['operatorid']);

        $page = array();
        $page['havemenu'] = !$request->query->has('nomenu');
        $page['showonline'] = (Settings::get('showonlineoperators') == '1');
        $page['showvisitors'] = (Settings::get('enabletracking') == '1');
        $page['title'] = getlocal("List of visitors waiting");
        $page['menuid'] = "users";

        $page = array_merge($page, prepare_menu($operator));

        // Attach files of the client side application and start it
        $this->getAssetManager()->attachJs('js/compiled/users_app.js');
        $this->getAssetManager()->attachJs(
            $this->startJsApplication($request, $operator),
            \Mibew\Asset\AssetManagerInterface::INLINE,
            1000
        );

        return $this->render('users', $page);
    }
Esempio n. 2
0
File: users.php Progetto: kuell/chat
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once '../libs/common.php';
require_once '../libs/operator.php';
require_once '../libs/groups.php';
$operator = check_login();
$status = isset($_GET['away']) ? 1 : 0;
notify_operator_alive($operator['operatorid'], $status);
$link = connect();
loadsettings_($link);
$_SESSION["{$mysqlprefix}operatorgroups"] = get_operator_groupslist($operator['operatorid'], $link);
mysql_close($link);
$page = array();
$page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1";
$page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0";
$page['frequency'] = $settings['updatefrequency_operator'];
$page['istatus'] = $status;
$page['showonline'] = $settings['showonlineoperators'] == '1' ? "1" : "0";
prepare_menu($operator);
start_html_output();
require '../view/pending_users.php';
Esempio n. 3
0
 /**
  * Update chat window state. API function
  * Call periodically by chat window.
  *
  * @param array $args Associative array of arguments. It must contains the
  *   following keys:
  *    - 'agentId': Id of the agent related to users window
  */
 protected function apiUpdate($args)
 {
     // Check access and get operator array
     $operator = $this->checkOperator($args['agentId']);
     // Update operator status
     notify_operator_alive($operator['operatorid'], $operator['istatus']);
     // Close old threads
     Thread::closeOldThreads();
     // Load stored requests
     $stored_requests = $this->getRequestsFromBuffer('users_' . $args['agentId']);
     if ($stored_requests !== false) {
         $this->responses = array_merge($this->responses, $stored_requests);
     }
 }