Esempio n. 1
0
function tpl_menu()
{
    global $page, $webimroot, $errors;
    if (isset($page['isOnline']) && !$page['isOnline']) {
        ?>
			<li id="offwarn">
				<img src="<?php 
        echo $webimroot;
        ?>
/images/dash/warn.gif" alt="" width="24" height="24"/>
				<p><?php 
        echo getlocal2("menu.goonline", array($webimroot . "/operator/users.php?nomenu"));
        ?>
</p>
			</li>		
<?php 
    }
    if (isset($page['operator'])) {
        ?>
			<li>
				<h2><?php 
        echo getlocal('right.main');
        ?>
</h2>
				<ul class="submenu">
					<li<?php 
        menuli("main");
        ?>
><a href='<?php 
        echo $webimroot;
        ?>
/operator/index.php'><?php 
        echo getlocal('topMenu.main');
        ?>
</a></li>
					<li<?php 
        menuli("users");
        ?>
><a href='<?php 
        echo $webimroot;
        ?>
/operator/users.php'><?php 
        echo getlocal('topMenu.users');
        ?>
</a> <span class="small">(<a class="inner" href='<?php 
        echo $webimroot;
        ?>
/operator/users.php?nomenu'><?php 
        echo getlocal('topMenu.users.nomenu');
        ?>
</a>)</span></li>
					<li<?php 
        menuli("history");
        ?>
><a href='<?php 
        echo $webimroot;
        ?>
/operator/history.php'><?php 
        echo getlocal('page_analysis.search.title');
        ?>
</a></li>
<?php 
        if (isset($page['showstat']) && $page['showstat']) {
            ?>
					<li<?php 
            menuli("statistics");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/statistics.php'><?php 
            echo getlocal('statistics.title');
            ?>
</a></li>
<?php 
        }
        if (isset($page['showban']) && $page['showban']) {
            ?>
					<li<?php 
            menuli("blocked");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/blocked.php'><?php 
            echo getlocal('menu.blocked');
            ?>
</a></li>
<?php 
        }
        ?>
				</ul>
			</li>
			<li>
				<h2><?php 
        echo getlocal('right.administration');
        ?>
</h2>
				<ul class="submenu">
					<li<?php 
        menuli("canned");
        ?>
><a href='<?php 
        echo $webimroot;
        ?>
/operator/canned.php'><?php 
        echo getlocal('menu.canned');
        ?>
</a></li>
<?php 
        if (isset($page['showadmin']) && $page['showadmin']) {
            ?>
					<li<?php 
            menuli("getcode");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/getcode.php'><?php 
            echo getlocal('leftMenu.client_gen_button');
            ?>
</a></li>
					<li<?php 
            menuli("operators");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/operators.php'><?php 
            echo getlocal('leftMenu.client_agents');
            ?>
</a></li>
<?php 
            if (isset($page['showgroups']) && $page['showgroups']) {
                ?>
					<li<?php 
                menuli("groups");
                ?>
><a href='<?php 
                echo $webimroot;
                ?>
/operator/groups.php'><?php 
                echo getlocal('menu.groups');
                ?>
</a></li>
<?php 
            }
            ?>
					<li<?php 
            menuli("settings");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/settings.php'><?php 
            echo getlocal('leftMenu.client_settings');
            ?>
</a></li>
					<li<?php 
            menuli("translate");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/translate.php'><?php 
            echo getlocal('menu.translate');
            ?>
</a></li>
					<li<?php 
            menuli("updates");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/updates.php'><?php 
            echo getlocal('menu.updates');
            ?>
</a></li>
					<li<?php 
            menuli("notifications");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/notifications.php'><?php 
            echo getlocal('menu.notifications');
            ?>
</a></li>
<?php 
        }
        if (isset($page['currentopid']) && $page['currentopid']) {
            ?>
					<li<?php 
            menuli("profile");
            ?>
><a href='<?php 
            echo $webimroot;
            ?>
/operator/operator.php?op=<?php 
            echo $page['currentopid'];
            ?>
'><?php 
            echo getlocal('menu.profile');
            ?>
</a></li>
<?php 
        }
        ?>
				</ul>
			</li>
			<li>
				<h2><?php 
        echo getlocal('right.other');
        ?>
</h2>
				<ul class="submenu">
					<li><a href='<?php 
        echo $webimroot;
        ?>
/operator/logout.php'><?php 
        echo getlocal('topMenu.logoff');
        ?>
</a></li>
				</ul>
			</li>
<?php 
    }
}
Esempio n. 2
0
    setup_logo();
    expand("../styles", "{$preview}", "{$show}.tpl");
    exit;
}
if ($show == 'mailsent' || $show == 'error') {
    $page['email'] = "*****@*****.**";
    setup_logo();
    expand("../styles", "{$preview}", "{$show}.tpl");
    exit;
}
if ($show == 'redirect' || $show == 'redirected' || $show == 'agentchat' || $show == 'agentrochat') {
    setup_chatview_for_operator(array('threadid' => 0, 'userName' => getstring("chat.default.username"), 'remote' => "1.2.3.4", 'agentId' => 1, 'groupid' => 0, 'userid' => 'visitor1', 'locale' => $current_locale, 'ltoken' => $show == 'agentrochat' ? 124 : 123), array('operatorid' => $show == 'agentrochat' ? 2 : 1));
    if ($show == 'redirect') {
        setup_redirect_links(0, $show == 'agentrochat' ? 124 : 123);
    } elseif ($show == 'redirected') {
        $page['message'] = getlocal2("chat.redirected.content", array("Administrator"));
    }
    $page['redirectLink'] = "{$webimroot}/operator/themes.php?preview={$preview}&amp;show=redirect";
    expand("../styles", "{$preview}", "{$show}.tpl");
    exit;
}
$templateList = array(array('label' => getlocal("page.preview.userchat"), 'id' => 'chat', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.chatsimple"), 'id' => 'chatsimple', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.nochat"), 'id' => 'nochat', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.survey"), 'id' => 'survey', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.leavemessage"), 'id' => 'leavemessage', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.leavemessagesent"), 'id' => 'leavemessagesent', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.mail"), 'id' => 'mail', 'h' => 254, 'w' => 603), array('label' => getlocal("page.preview.mailsent"), 'id' => 'mailsent', 'h' => 254, 'w' => 603), array('label' => getlocal("page.preview.redirect"), 'id' => 'redirect', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.redirected"), 'id' => 'redirected', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.agentchat"), 'id' => 'agentchat', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.agentrochat"), 'id' => 'agentrochat', 'h' => 480, 'w' => 640), array('label' => getlocal("page.preview.error"), 'id' => 'error', 'h' => 480, 'w' => 640));
$template = verifyparam("template", "/^\\w+\$/", "chat");
$page['formpreview'] = $preview;
$page['formtemplate'] = $template;
$page['canshowerrors'] = $template == 'leavemessage' || $template == 'mail' || $template == 'all';
$page['formshowerr'] = $showerrors;
$page['availablePreviews'] = $stylelist;
$page['availableTemplates'] = array("chat", "chatsimple", "nochat", "survey", "leavemessage", "leavemessagesent", "mail", "mailsent", "redirect", "redirected", "agentchat", "agentrochat", "error", "all");
$page['showlink'] = "{$webimroot}/operator/themes.php?preview={$preview}&amp;" . ($showerrors ? "showerr=on&amp;" : "") . "show=";
$page['previewList'] = array();
Esempio n. 3
0
function tpl_content()
{
    global $page, $mibewroot;
    ?>

<div id="confirmpane">
	<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">

		<?php 
    echo getlocal2("confirm.take.message", array(safe_htmlspecialchars($page['user']), safe_htmlspecialchars($page['agent'])));
    ?>
<br/><br/>
		<br/>

		<div>
		<table class="nicebutton"><tr>
			<td><a href="<?php 
    echo safe_htmlspecialchars($page['link']);
    ?>
">
				<img src="<?php 
    echo $mibewroot;
    ?>
/images/submit.gif" width="40" height="35" border="0" alt="" /></a></td>
			<td class="submit"><a href="<?php 
    echo safe_htmlspecialchars($page['link']);
    ?>
">
				<?php 
    echo getlocal("confirm.take.yes");
    ?>
</a></td>
			<td><a href="<?php 
    echo safe_htmlspecialchars($page['link']);
    ?>
">
				<img src="<?php 
    echo $mibewroot;
    ?>
/images/submitrest.gif" width="10" height="35" border="0" alt="" /></a></td>
		</tr></table>

		<table class="nicebutton"><tr>
			<td><a href="javascript:window.close();">
				<img src="<?php 
    echo $mibewroot;
    ?>
/images/submit.gif" width="40" height="35" border="0" alt="" /></a></td>
			<td class="submit"><a href="javascript:window.close();">
				<?php 
    echo getlocal("confirm.take.no");
    ?>
</a></td>
			<td><a href="javascript:window.close();">
				<img src="<?php 
    echo $mibewroot;
    ?>
/images/submitrest.gif" width="10" height="35" border="0" alt="" /></a></td>
		</tr></table>
		
		<br clear="all"/>
		</div>
				
	</div><div class="formbottom"><div class="formbottomi"></div></div></div>
</div>		

<?php 
}
Esempio n. 4
0
function check_status()
{
    global $page, $webimroot, $settings, $dbversion;
    $page['done'][] = getlocal2("install.0.php", array(phpversion()));
    if (!check_webimroot()) {
        return;
    }
    if (!check_files()) {
        return;
    }
    $link = check_connection();
    if (!$link) {
        return;
    }
    if (!check_database($link)) {
        mysql_close($link);
        return;
    }
    if (!check_tables($link)) {
        mysql_close($link);
        return;
    }
    if (!check_columns($link)) {
        mysql_close($link);
        return;
    }
    check_sound();
    $page['done'][] = getlocal("installed.message");
    if (!check_admin($link)) {
        $page['nextstep'] = getlocal("installed.login_link");
        $page['nextnotice'] = getlocal2("installed.notice", array("{$webimroot}/install/"));
        $page['nextstepurl'] = "{$webimroot}/operator/login.php?login=admin";
    }
    $page['show_small_login'] = true;
    mysql_close($link);
    loadsettings();
    $settings['dbversion'] = $dbversion;
    update_settings();
}
Esempio n. 5
0
        if ($thread['istate'] == $state_chatting) {
            $link = connect();
            commit_thread($threadid, array("istate" => intval($state_waiting), "nextagent" => 0, "groupid" => intval($nextid), "agentId" => 0, "agentName" => "''"), $link);
            post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)), $thread['locale'], true), $link);
            mysql_close($link);
        } else {
            $errors[] = getlocal("chat.redirect.cannot");
        }
    } else {
        $errors[] = getlocal("chat.redirect.unknown_group");
    }
} else {
    $nextid = verifyparam("nextAgent", "/^\\d{1,10}\$/");
    $nextOperator = operator_by_id($nextid);
    if ($nextOperator) {
        $page['message'] = getlocal2("chat.redirected.content", array(safe_htmlspecialchars(topage(get_operator_name($nextOperator)))));
        if ($thread['istate'] == $state_chatting) {
            $link = connect();
            $threadupdate = array("istate" => intval($state_waiting), "nextagent" => intval($nextid), "agentId" => 0);
            if ($thread['groupid'] != 0) {
                if (FALSE === select_one_row("select groupid from {$mysqlprefix}chatgroupoperator where operatorid = " . intval($nextid) . " and groupid = " . intval($thread['groupid']), $link)) {
                    $threadupdate['groupid'] = 0;
                }
            }
            commit_thread($threadid, $threadupdate, $link);
            post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)), $thread['locale'], true), $link);
            mysql_close($link);
        } else {
            $errors[] = getlocal("chat.redirect.cannot");
        }
    } else {
Esempio n. 6
0
function wrong_field($key)
{
    return getlocal2("errors.wrong_field", array(getlocal($key)));
}
Esempio n. 7
0
File: ban.php Progetto: kuell/chat
function tpl_content()
{
    global $page, $mibewroot, $errors;
    ?>

<?php 
    if ($page['saved']) {
        ?>
	<?php 
        echo getlocal2("page_ban.sent", array(safe_htmlspecialchars($page['address'])));
        ?>

	<script type="text/javascript"><!--
		setTimeout( (function() { window.close(); }), 1500 );
	//--></script>
<?php 
    } else {
        ?>

<?php 
        echo getlocal("page_ban.intro");
        ?>
<br/>
<br/>
<?php 
        require_once 'inc_errors.php';
        ?>


<?php 
        if ($page['thread']) {
            ?>
	<?php 
            echo getlocal2("page_ban.thread", array(safe_htmlspecialchars($page['thread'])));
            ?>
<br/>
	<br/>
<?php 
        }
        ?>

<form name="banForm" method="post" action="<?php 
        echo $mibewroot;
        ?>
/operator/ban.php">
<?php 
        print_csrf_token_input();
        ?>
<input type="hidden" name="banId" value="<?php 
        echo safe_htmlspecialchars($page['banId']);
        ?>
"/>
<?php 
        if ($page['threadid']) {
            ?>
<input type="hidden" name="threadid" value="<?php 
            echo safe_htmlspecialchars($page['threadid']);
            ?>
"/>
<?php 
        }
        ?>
	<div class="mform"><div class="formtop"><div class="formtopi"></div></div><div class="forminner">
	
	<div class="fieldForm">
		<div class="field">
			<div class="flabel"><?php 
        echo getlocal('form.field.address');
        ?>
<span class="required">*</span></div>
			<div class="fvalue">
				<input type="text" name="address" size="40" value="<?php 
        echo form_value('address');
        ?>
" class="formauth"/>
			</div>
			<div class="fdescr"> &mdash; <?php 
        echo getlocal('form.field.address.description');
        ?>
</div>
			<br clear="all"/>
		</div>

		<div class="field">
			<div class="flabel"><?php 
        echo getlocal('form.field.ban_days');
        ?>
<span class="required">*</span></div>
			<div class="fvalue">
				<input type="text" name="days" size="4" value="<?php 
        echo form_value('days');
        ?>
" class="formauth"/>
			</div>
			<div class="fdescr"> &mdash; <?php 
        echo getlocal('form.field.ban_days.description');
        ?>
</div>
			<br clear="all"/>
		</div>

		<div class="field">
			<div class="flabel"><?php 
        echo getlocal('form.field.ban_comment');
        ?>
<span class="required">*</span></div>
			<div class="fvalue">
				<input type="text" name="comment" size="40" value="<?php 
        echo form_value('comment');
        ?>
" class="formauth"/>
			</div>
			<div class="fdescr"> &mdash; <?php 
        echo getlocal('form.field.ban_comment.description');
        ?>
</div>
			<br clear="all"/>
		</div>
		
		<div class="fbutton">
			<input type="image" name="save" value="" src="<?php 
        echo $mibewroot . safe_htmlspecialchars(getlocal("image.button.save"));
        ?>
" alt="<?php 
        echo safe_htmlspecialchars(getlocal("button.save"));
        ?>
"/>
		</div>
	</div>
	
	</div><div class="formbottom"><div class="formbottomi"></div></div></div>
	
	<div class="asterisk">
		<?php 
        echo getlocal("common.asterisk_explanation");
        ?>
	</div>
	
</form>
<?php 
    }
    ?>


<?php 
}
Esempio n. 8
0
function expand_var($matches)
{
    global $page, $mibewroot, $jsver, $errors, $current_style;
    $prefix = $matches[1];
    $var = $matches[2];
    if (!$prefix) {
        if ($var == 'mibewroot') {
            return $mibewroot;
        } else {
            if ($var == 'jsver') {
                return $jsver;
            } else {
                if ($var == 'tplroot') {
                    return "{$mibewroot}/styles/{$current_style}";
                } else {
                    if ($var == 'styleid') {
                        return $current_style;
                    } else {
                        if ($var == 'pagination') {
                            return generate_pagination($page['pagination']);
                        } else {
                            if ($var == 'errors' || $var == 'harderrors') {
                                if (isset($errors) && count($errors) > 0) {
                                    $result = getlocal("{$var}.header");
                                    foreach ($errors as $e) {
                                        $result .= getlocal("errors.prefix") . $e . getlocal("errors.suffix");
                                    }
                                    $result .= getlocal("errors.footer");
                                    return $result;
                                }
                            }
                        }
                    }
                }
            }
        }
    } else {
        if ($prefix == 'msg:' || $prefix == 'url:') {
            if (strpos($var, ",") !== false) {
                $pos = strpos($var, ",");
                $param = substr($var, $pos + 1);
                $var = substr($var, 0, $pos);
                return getlocal2($var, array($page[$param]));
            }
            return getlocal($var);
        } else {
            if ($prefix == 'form:') {
                return form_value($var);
            } else {
                if ($prefix == 'page:') {
                    return isset($page[$var]) ? $page[$var] : "";
                } else {
                    if ($prefix == 'if:' || $prefix == 'else:' || $prefix == 'endif:' || $prefix == 'ifnot:') {
                        return "<!-- wrong {$prefix}:{$var} -->";
                    }
                }
            }
        }
    }
    return "";
}
Esempio n. 9
0
	<div id="header">
		<div id="title">
			<h1><img src="<?php 
echo $webimroot;
?>
/images/logo.gif" alt="" width="32" height="32" class="left" />
				<a href="#"><?php 
echo isset($page['headertitle']) ? $page['headertitle'] : $page['title'];
?>
</a></h1>
		</div>
<?php 
if (isset($page) && isset($page['operator'])) {
    ?>
		<div id="path"><p><?php 
    echo getlocal2("menu.operator", array($page['operator']));
    ?>
</p></div>
<?php 
} else {
    if (isset($page) && isset($page['show_small_login'])) {
        ?>
		<div id="loginsmallpane">
			<form name="smallLogin" method="post" action="<?php 
        echo $webimroot;
        ?>
/operator/login.php">
				<?php 
        echo getlocal("page_login.login");
        ?>
				<input type="text" name="login" size="8" class="formauth"/>
Esempio n. 10
0
File: menu.php Progetto: kuell/chat
function tpl_content()
{
    global $page, $mibewroot, $current_locale, $menuItemsCount, $version;
    ?>

<br/>

<?php 
    if ($page['needChangePassword']) {
        ?>
<div id="formmessage"><?php 
        echo getlocal("error.no_password");
        ?>
 <?php 
        echo getlocal2("error.no_password.visit_profile", array(safe_htmlspecialchars($page['profilePage'])));
        ?>
</div>
<br/>
<?php 
    } else {
        if ($page['needUpdate']) {
            ?>
<div id="formmessage"><?php 
            echo getlocal2("install.updatedb", array(safe_htmlspecialchars($page['updateWizard'])));
            ?>
</div>
<br/>
<?php 
        } else {
            if ($page['newFeatures']) {
                ?>
<div><div id="formmessage"><?php 
                echo getlocal2("install.newfeatures", array(safe_htmlspecialchars($page['featuresPage']), safe_htmlspecialchars($version)));
                ?>
</div></div>
<br/>
<?php 
            }
        }
    }
    ?>

<table id="dashboard">
<tr>
	<td class="dashitem">
		<img src="<?php 
    echo $mibewroot;
    ?>
/images/dash/visitors.gif" alt=""/>
		<a href="<?php 
    echo $mibewroot;
    ?>
/operator/users.php">
			<?php 
    echo getlocal('topMenu.users');
    ?>
</a>
		<?php 
    echo getlocal('page_client.pending_users');
    ?>
	</td>

	<td class="dashitem">
		<img src="<?php 
    echo $mibewroot;
    ?>
/images/dash/history.gif" alt=""/>
		<a href="<?php 
    echo $mibewroot;
    ?>
/operator/history.php">
			<?php 
    echo getlocal('page_analysis.search.title');
    ?>
</a>
		<?php 
    echo getlocal('content.history');
    ?>
	</td>
<?php 
    $menuItemsCount = 2;
    ?>

<?php 
    if ($page['showstat']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/stat.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/statistics.php">
			<?php 
        echo getlocal('statistics.title');
        ?>
</a>
		<?php 
        echo getlocal('statistics.description');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

<?php 
    if ($page['showban']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/blocked.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/blocked.php">
			<?php 
        echo getlocal('menu.blocked');
        ?>
</a>
		<?php 
        echo getlocal('content.blocked');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

	<td class="dashitem">
		<img src="<?php 
    echo $mibewroot;
    ?>
/images/dash/canned.gif" alt=""/>
		<a href="<?php 
    echo $mibewroot;
    ?>
/operator/canned.php">
			<?php 
    echo getlocal('menu.canned');
    ?>
</a>
		<?php 
    echo getlocal('canned.descr');
    ?>
	</td>
	<?php 
    menuseparator();
    ?>

<?php 
    if ($page['showadmin']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/getcode.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/getcode.php">
			<?php 
        echo getlocal('leftMenu.client_gen_button');
        ?>
</a>
		<?php 
        echo getlocal('admin.content.client_gen_button');
        ?>
	</td>
	<?php 
        menuseparator();
        ?>

	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/operators.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/operators.php">
			<?php 
        echo getlocal('leftMenu.client_agents');
        ?>
</a>
		<?php 
        echo getlocal('admin.content.client_agents');
        ?>
	</td>
	<?php 
        menuseparator();
        ?>

<?php 
        if ($page['showgroups']) {
            ?>
	<td class="dashitem">
		<img src="<?php 
            echo $mibewroot;
            ?>
/images/dash/dep.gif" alt=""/>
		<a href="<?php 
            echo $mibewroot;
            ?>
/operator/groups.php">
			<?php 
            echo getlocal('menu.groups');
            ?>
</a>
		<?php 
            echo getlocal('menu.groups.content');
            ?>
	</td>
	<?php 
            menuseparator();
        }
        ?>

	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/settings.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/settings.php">
			<?php 
        echo getlocal('leftMenu.client_settings');
        ?>
</a>
		<?php 
        echo getlocal('admin.content.client_settings');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

<?php 
    if (isset($page['currentopid']) && $page['currentopid']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/profile.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/operator.php?op=<?php 
        echo urlencode($page['currentopid']);
        ?>
">
			<?php 
        echo getlocal('menu.profile');
        ?>
</a>
		<?php 
        echo getlocal('menu.profile.content');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

<?php 
    if (isset($page) && isset($page['localeLinks'])) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/locale.gif" alt=""/>
		<a href="#" id="changelang">
			<?php 
        echo getlocal('menu.locale');
        ?>
</a>
		<?php 
        echo getlocal('menu.locale.content');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

<?php 
    if ($page['showadmin']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/updates.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/updates.php">
			<?php 
        echo getlocal('menu.updates');
        ?>
</a>
		<?php 
        echo getlocal('menu.updates.content');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

<?php 
    if ($page['showadmin'] || $page['shownotifications']) {
        ?>
	<td class="dashitem">
		<img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/notifications.gif" alt=""/>
		<a href="<?php 
        echo $mibewroot;
        ?>
/operator/notifications.php">
			<?php 
        echo getlocal('menu.notifications');
        ?>
</a>
		<?php 
        echo getlocal('menu.notifications.content');
        ?>
	</td>
	<?php 
        menuseparator();
    }
    ?>

	<td class="dashitem">
		<img src="<?php 
    echo $mibewroot;
    ?>
/images/dash/exit.gif" alt=""/>
		<a href="<?php 
    echo $mibewroot;
    ?>
/operator/logout.php">
			<?php 
    echo getlocal('topMenu.logoff');
    ?>
</a>
		<?php 
    echo getlocal('content.logoff');
    ?>
	</td>
</tr>

</table>

<?php 
    if (isset($page) && isset($page['localeLinks'])) {
        ?>
<div id="dashlocalesPopup">
	<a href="#" id="dashlocalesPopupClose"><img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/close.gif" alt="X"/></a>
	<h2><img src="<?php 
        echo $mibewroot;
        ?>
/images/dash/locale.gif"  alt=""/>
	<b><?php 
        echo getlocal("lang.choose");
        ?>
</b></h2>
	<ul class="locales">
<?php 
        foreach ($page['localeLinks'] as $id => $title) {
            ?>
		<li<?php 
            echo $current_locale == $id ? " class=\"active\"" : "";
            ?>
 ><a href="?locale=<?php 
            echo urlencode($id);
            ?>
"><?php 
            echo safe_htmlspecialchars($title);
            ?>
</a></li>
<?php 
        }
        ?>
	</ul>
</div>
<div id="backgroundPopup"></div>
<?php 
    }
    ?>

<?php 
}
Esempio n. 11
0
File: ban.php Progetto: kuell/chat
 $comment = getparam('comment');
 $threadid = isset($_POST['threadid']) ? getparam('threadid') : "";
 if (!$address) {
     $errors[] = no_field("form.field.address");
 }
 if (!preg_match("/^\\d+\$/", $days)) {
     $errors[] = wrong_field("form.field.ban_days");
 }
 if (!$comment) {
     $errors[] = no_field("form.field.ban_comment");
 }
 $link = connect();
 $existing_ban = ban_for_addr_($address, $link);
 mysql_close($link);
 if (!$banId && $existing_ban || $banId && $existing_ban && $banId != $existing_ban['banid']) {
     $errors[] = getlocal2("ban.error.duplicate", array(safe_htmlspecialchars($address), safe_htmlspecialchars($existing_ban['banid'])));
 }
 if (count($errors) == 0) {
     $link = connect();
     $utime = time() + $days * 24 * 60 * 60;
     if (!$banId) {
         $query = sprintf("insert into {$mysqlprefix}chatban (dtmcreated,dtmtill,address,comment) values (CURRENT_TIMESTAMP,%s,'%s','%s')", "FROM_UNIXTIME(" . intval($utime) . ")", mysql_real_escape_string($address, $link), mysql_real_escape_string($comment, $link));
         perform_query($query, $link);
     } else {
         $query = sprintf("update {$mysqlprefix}chatban set dtmtill = %s,address = '%s',comment = '%s' where banid = %s", "FROM_UNIXTIME(" . intval($utime) . ")", mysql_real_escape_string($address, $link), mysql_real_escape_string($comment, $link), intval($banId));
         perform_query($query, $link);
     }
     mysql_close($link);
     if (!$threadid) {
         header("Location: {$mibewroot}/operator/blocked.php");
         exit;
Esempio n. 12
0
function generate_pagination($pagination, $bottom = true)
{
    global $pagination_spacing, $links_on_page;
    $result = getlocal2("tag.pagination.info", array($pagination['page'], $pagination['total'], $pagination['start'] + 1, $pagination['end'], $pagination['count'])) . "<br/>";
    if ($pagination['total'] > 1) {
        if (!$bottom) {
            $result = "";
        } else {
            $result .= "<br/>";
        }
        $result .= "<div class='pagination'>";
        $curr_page = $pagination['page'];
        $minPage = max($curr_page - $links_on_page, 1);
        $maxPage = min($curr_page + $links_on_page, $pagination['total']);
        if ($curr_page > 1) {
            $result .= generate_pagination_link($curr_page - 1, generate_pagination_image("prevpage", getlocal("tag.pagination.previous"))) . $pagination_spacing;
        }
        for ($i = $minPage; $i <= $maxPage; $i++) {
            $title = abs($curr_page - $i) >= $links_on_page && $i != 1 ? "..." : $i;
            if ($i != $curr_page) {
                $result .= generate_pagination_link($i, $title);
            } else {
                $result .= "<span class=\"pagecurrent\">{$title}</span>";
            }
            if ($i < $maxPage) {
                $result .= $pagination_spacing;
            }
        }
        if ($curr_page < $pagination['total']) {
            $result .= $pagination_spacing . generate_pagination_link($curr_page + 1, generate_pagination_image("nextpage", getlocal("tag.pagination.next")));
        }
        $result .= "</div>";
    }
    return $result;
}
Esempio n. 13
0
 $comment = getparam('comment');
 $threadid = isset($_POST['threadid']) ? getparam('threadid') : "";
 if (!$address) {
     $errors[] = no_field("form.field.address");
 }
 if (!preg_match("/^\\d+\$/", $days)) {
     $errors[] = wrong_field("form.field.ban_days");
 }
 if (!$comment) {
     $errors[] = no_field("form.field.ban_comment");
 }
 $link = connect();
 $existing_ban = ban_for_addr_($address, $link);
 mysql_close($link);
 if (!$banId && $existing_ban || $banId && $existing_ban && $banId != $existing_ban['banid']) {
     $errors[] = getlocal2("ban.error.duplicate", array($address, $existing_ban['banid']));
 }
 if (count($errors) == 0) {
     $link = connect();
     $utime = time() + $days * 24 * 60 * 60;
     if (!$banId) {
         $query = sprintf("insert into {$mysqlprefix}chatban (dtmcreated,dtmtill,address,comment) values (CURRENT_TIMESTAMP,%s,'%s','%s')", "FROM_UNIXTIME({$utime})", mysql_real_escape_string($address, $link), mysql_real_escape_string($comment, $link));
         perform_query($query, $link);
     } else {
         $query = sprintf("update {$mysqlprefix}chatban set dtmtill = %s,address = '%s',comment = '%s' where banid = {$banId}", "FROM_UNIXTIME({$utime})", mysql_real_escape_string($address, $link), mysql_real_escape_string($comment, $link));
         perform_query($query, $link);
     }
     mysql_close($link);
     if (!$threadid) {
         header("Location: {$webimroot}/operator/blocked.php");
         exit;
Esempio n. 14
0
	<div id="header">
		<div id="title">
			<h1><img src="<?php 
echo $mibewroot;
?>
/images/logo.png" alt="" width="32" height="32" class="left logo" />
				<a href="#"><?php 
echo isset($page['headertitle']) ? safe_htmlspecialchars($page['headertitle']) : safe_htmlspecialchars($page['title']);
?>
</a></h1>
		</div>
<?php 
if (isset($page) && isset($page['operator'])) {
    ?>
		<div id="path"><p><?php 
    echo getlocal2("menu.operator", array(safe_htmlspecialchars($page['operator'])));
    ?>
</p></div>
<?php 
} else {
    if (isset($page) && isset($page['show_small_login']) && $page['show_small_login']) {
        ?>
		<div id="loginsmallpane">
			<form name="smallLogin" method="post" action="<?php 
        echo $mibewroot;
        ?>
/operator/login.php">
				<?php 
        echo getlocal("page_login.login");
        ?>
				<input type="text" name="login" size="8" class="formauth"/>
Esempio n. 15
0
        if ($thread['istate'] == $state_chatting) {
            $link = connect();
            commit_thread($threadid, array("istate" => $state_waiting, "nextagent" => 0, "groupid" => $nextid, "agentId" => 0, "agentName" => "''"), $link);
            post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)), $thread['locale']), $link);
            mysql_close($link);
        } else {
            $errors[] = getlocal("chat.redirect.cannot");
        }
    } else {
        $errors[] = "Unknown group";
    }
} else {
    $nextid = verifyparam("nextAgent", "/^\\d{1,8}\$/");
    $nextOperator = operator_by_id($nextid);
    if ($nextOperator) {
        $page['message'] = getlocal2("chat.redirected.content", array(topage(get_operator_name($nextOperator))));
        if ($thread['istate'] == $state_chatting) {
            $link = connect();
            $threadupdate = array("istate" => $state_waiting, "nextagent" => $nextid, "agentId" => 0);
            if ($thread['groupid'] != 0) {
                if (FALSE === select_one_row("select groupid from {$mysqlprefix}chatgroupoperator where operatorid = {$nextid} and groupid = " . $thread['groupid'], $link)) {
                    $threadupdate['groupid'] = 0;
                }
            }
            commit_thread($threadid, $threadupdate, $link);
            post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)), $thread['locale']), $link);
            mysql_close($link);
        } else {
            $errors[] = getlocal("chat.redirect.cannot");
        }
    } else {