Skip to content

Commit

Permalink
added permission for admin snoop
Browse files Browse the repository at this point in the history
Signed-off-by: SAMods <wdm2005@blueyonder.co.uk>
  • Loading branch information
SAMods committed Jun 29, 2014
1 parent 7b4bfba commit 7c4a25a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions Sources/SAChatHooks.php
Expand Up @@ -119,6 +119,7 @@ function SAChat_load_permissions(&$permissionGroups, &$permissionList, &$leftPer
'2sichat_bar_close' => array(false, '2sichat', '2sichat'),
'2sichat_bar_buddys' => array(false, '2sichat', '2sichat'),
'2sichat_bar_theme' => array(false, '2sichat', '2sichat'),
'2sichat_bar_adminmode' => array(false, '2sichat', '2sichat'),
);

$context['non_guest_permissions'] = array_merge(
Expand Down
1 change: 1 addition & 0 deletions Themes/default/languages/2sichat.english.php
Expand Up @@ -95,6 +95,7 @@
$txt['permissionname_2sichat_bar_close'] = 'Allowed to disable bar';
$txt['permissionname_2sichat_bar_theme'] = 'Allowed to change themes';
$txt['permissionname_2sichat_bar_buddys'] = 'Allowed to choose who to talk to';
$txt['permissionname_2sichat_bar_adminmode'] = 'Allowed to use admin mode';
$txt['2silempty'] = 'Left empty!';
$txt['2silempty1'] = 'Must be numeric!';
$txt['2sichat_mn_heart_timeout'] = 'Heartbeat timeout';
Expand Down
1 change: 1 addition & 0 deletions Themes/default/languages/2sichat.italian.php
Expand Up @@ -95,6 +95,7 @@
$txt['permissionname_2sichat_bar_close'] = 'Autorizzato a disabilitare la barra';
$txt['permissionname_2sichat_bar_theme'] = 'Autorizzato a cambiare i temi';
$txt['permissionname_2sichat_bar_buddys'] = 'Autorizzato a scegliere con chi chattare';
$txt['permissionname_2sichat_bar_adminmode'] = 'Allowed to use admin mode';
$txt['2silempty'] = 'Lasciato vuoto!';
$txt['2silempty1'] = 'Deve essere numerico!';
$txt['2sichat_mn_heart_timeout'] = 'Timeout aggiornamento';
Expand Down
2 changes: 1 addition & 1 deletion sachat/themes/default/js/body.js.php
Expand Up @@ -5,7 +5,7 @@
**/
function initchat() {

global $user_settings, $budCount, $member_id, $usershowBar,$buddy_settings, $boardurl, $options, $modSettings, $themeurl, $thjs, $context;
global $user_settings, $buddies, $budCount, $member_id, $usershowBar,$buddy_settings, $boardurl, $options, $modSettings, $themeurl, $thjs, $context;

if ($member_id && empty($modSettings['2sichat_dis_bar'])) {
$bar = addslashes(preg_replace("/\r?\n?\t/m", "", chat_bar_template()));
Expand Down
4 changes: 2 additions & 2 deletions sachat/themes/default/template.php
Expand Up @@ -247,7 +247,7 @@ function chat_extra_template() {

function buddy_list_template() { //The buddy list.

global $context, $txt, $admin, $modSettings;
global $context, $txt, $admin, $permission, $modSettings;

$data = '
<div class="buddyboxhead">
Expand All @@ -263,7 +263,7 @@ function buddy_list_template() { //The buddy list.
$data .= '
<div class="buddyboxcontent">';

if(!empty($admin['is_admin'])){
if(!empty($admin['is_admin']) || isset($permission['2sichat_bar_adminmode'])){
$data .='<input type="button" onclick="javascript:snooper(); return false;" value="'.$txt['bar_admin_snoop'].'" />';

if(!empty($_COOKIE[$modSettings['2sichat_cookie_name']."_chatSnoop"])){
Expand Down

0 comments on commit 7c4a25a

Please sign in to comment.