Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code layout #13

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
14 changes: 9 additions & 5 deletions GoogleOauth.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ function resources() {
return '';
}

return '
<meta name="redirectUri" content="' . plugin_config_get( 'redirect_uri' ) . '" />
<meta name="clientId" content="' . plugin_config_get( 'clientId' ) . '" />
<script type="text/javascript" src="plugins/GoogleOauth/pages/assets/js/plugin.js"></script>
';
$redirectUri = plugin_config_get( 'redirect_uri' );
$clientId = plugin_config_get( 'clientId' );

$res = '<meta name="redirectUri" content="' . $redirectUri . '" />';
$res .= '<meta name="clientId" content="' . $clientId . '" />';
$res .= '<script type="text/javascript" ' .
' src="' . plugin_file( 'plugin.js' ) . '"></script> ';

return $res;
}
}
30 changes: 29 additions & 1 deletion README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# MantisBT GoogleAuth Plugin
--------


[TOC]


Features
--------
1. Add Google oauth 2.0 support to login to MantisBT.
Expand Down Expand Up @@ -25,5 +32,26 @@ Supported Versions
------------------

- MantisBT 1.2.x - supported
- MantisBT 1.3.x - **not supported**
- MantisBT 2.x - supported (repository master branch)

Plugin Folder Structure
-----------------------
Struct has been changed to follow the MantisBT suggested folder structure and naming convention

./GoogleAuth/pages
./GoogleAuth/files
./GoogleAuth/library

Operations Flow
-----------------------
If installation was ok, when you access MantisBT login page you will see a new button

![](.//screens/login_screen_with_sign_in_with_google_button.png)

When you click on button 'Sign in with google' you will see something similar to:

![](.//screens/google_signin_screen.png)

Or this

![](.//screens/google_account_choice.png)
File renamed without changes.
19 changes: 17 additions & 2 deletions lang/strings_english.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,20 @@ $s_plugin_GoogleOauth_title = 'Google Oauth Setting';
$s_plugin_GoogleOauth_save = 'SAVE';

$s_plugin_GoogleOauth_login = 'Sign in with Google';
$s_plugin_AdminSetPassword_password_length = 'Enter a password with at least 6 characters.';
$s_plugin_AdminSetPassword_password_success = 'New password has been set successfully.';

$s_plugin_GoogleOauth_user_is_enabled_failure =
"<p>Email address not registered. Please register new account first. (on your mantis) <br/>";

$s_plugin_GoogleOauth_user_is_login_request_allowed_failure =
"<p>Email address not registered. Please register new account first. (on your mantis) <br/>";


$s_action_common =
'<a class="btn btn-primary btn-sm bigger-110" href="$$basehref$$/login_page.php">MantisBT Login Page</a>';

$s_plugin_GoogleOauth_user_is_anonymous = $s_action_common;

$s_plugin_GoogleOauth_user_is_enabled_failure_action = $s_action_common;

$s_plugin_GoogleOauth_user_is_login_request_allowed_failure_action =$s_action_common;

Empty file modified lang/strings_french.txt
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GoogleAuth Plugin external libraries
====================================

This directory contains a copy the 3rd-party libraries used by GoogleAuth.
Loading