Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebijk committed Oct 11, 2017
1 parent 93d46b4 commit 0114600
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# MyBB-Logout-Abfrage
Ask user if he want really log out from MyBB.

# Installation
Copy inc and languages to MyBB Folder and activate that in Pluginmanager.
64 changes: 64 additions & 0 deletions inc/plugins/logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Logout Abfrage für MyBB
* Webseite:
* http://www.mybbcoder.info /
* http://www.sebijk.com
* Lizenz: GPL
**/

if( !defined('IN_MYBB') )
{
die("Hacking attempt!");
}

/** Hooks einbinden **/
$plugins->add_hook("global_end", "logout_js");
$plugins->add_hook("pre_output_page", "logout");

/** Infos über Logout Abfrage **/
function logout_info()
{
return array(
"name" => "Logout Abfrage",
"description" => "Fragt den Benutzer ob er sich wirklich abmelden möchte.",
"website" => "http://www.sebijk.com",
"author" => "Home of the Sebijk.com",
"authorsite" => "http://www.sebijk.com",
"version" => "1.4",
"guid" => "",
"compatibility" => "16*"
);
}

function logout_js() {
global $lang, $headerinclude;
$lang->load("asklogout");

$headerinclude .= '<!-- start js code for logout -->
<script type="text/javascript" language="JavaScript">
<!--
function log_out()
{
grayfilter = document.getElementsByTagName("html");
grayfilter[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm(\''.$lang->confirm_logout.'\n'.$lang->confirm_logout_okcancel.'\'))
{
return true;
}
else
{
grayfilter[0].style.filter = "";
return false;
}
}
//-->
</script>
<!-- end js code for logout -->';
}

function logout($page) {
global $mybb;
$page = str_replace("action=logout&amp;logoutkey={$mybb->user['logoutkey']}", "action=logout&amp;logoutkey={$mybb->user['logoutkey']}\" onclick=\"return log_out()", $page);
}
?>
17 changes: 17 additions & 0 deletions languages/deutsch_du/asklogout.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.6 -
* Copyright (c) 2006 by Sebijk
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchtest du dich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
?>
17 changes: 17 additions & 0 deletions languages/deutsch_sie/asklogout.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.6 -
* Copyright (c) 2006 by Sebijk
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.com
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Möchten Sie sich wirklich abmelden?";
$l['confirm_logout_okcancel'] ="(OK = Ja | Abbrechen = Nein)";
?>
17 changes: 17 additions & 0 deletions languages/english/asklogout.lang.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Logout Abfrage
* Language File for MyBB 1.6 -
* Copyright (c) 2006 by Sebijk
*
* Webseite des Pluginersteller:
* http://www.mybbcoder.info /
* http://www.sebijk.de
*
* $Id: asklogout.lang.php
**/

$l['confirm_logout'] = "Are you really sure you want to logout?\n (OK = Yes | Cancel = No)";

?>

0 comments on commit 0114600

Please sign in to comment.