This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
8,025 additions
and
3,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,8 @@ | |
*.jpg binary | ||
*.odt binary | ||
*.odf binary | ||
|
||
# Ignore development files for production | ||
/build | ||
/docs | ||
/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
type = PO | ||
|
||
[zenfusionoauth.zenfusionoauth] | ||
file_filter = langs/<lang>/zenfusionoauth.lang | ||
source_file = langs/en_US/zenfusionoauth.lang | ||
source_lang = en_US | ||
lang_map = es: es_ES, fr:fr_FR, uz: uz_UZ, vi: vi_VN | ||
type = MOZILLAPROPERTIES | ||
|
||
[zenfusionoauth.about] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/about.po | ||
source_file = docs/_build/locale/about.pot | ||
source_lang = C | ||
|
||
[zenfusionoauth.install] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/install.po | ||
source_file = docs/_build/locale/install.pot | ||
source_lang = C | ||
|
||
[zenfusionoauth.user] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/user.po | ||
source_file = docs/_build/locale/user.pot | ||
source_lang = C | ||
|
||
[zenfusionoauth.index] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/index.po | ||
source_file = docs/_build/locale/index.pot | ||
source_lang = C | ||
|
||
[zenfusionoauth.admin] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/admin.po | ||
source_file = docs/_build/locale/admin.pot | ||
source_lang = C | ||
|
||
[zenfusionoauth.sphinx] | ||
file_filter = docs/locale/<lang>/LC_MESSAGES/sphinx.po | ||
source_file = docs/_build/locale/sphinx.pot | ||
source_lang = C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/* | ||
* ZenFusion OAuth - A Google OAuth authentication module for Dolibarr | ||
* Copyright (C) 2011 Sebastien Bodrero <[email protected]> | ||
* Copyright (C) 2011-2014 Raphaël Doursenaud <[email protected]> | ||
* Copyright (C) 2011-2017 Raphaël Doursenaud <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -23,17 +23,10 @@ | |
* \ingroup zenfusionoauth | ||
* Module about page | ||
*/ | ||
$res = 0; | ||
// from standard dolibarr install | ||
if (!$res && file_exists('../../main.inc.php')) { | ||
$res = @include '../../main.inc.php'; | ||
} | ||
// from custom dolibarr install | ||
if (!$res && file_exists('../../../main.inc.php')) { | ||
$res = @include '../../../main.inc.php'; | ||
} | ||
if (!$res) { | ||
die("Main include failed"); | ||
|
||
// Load Dolibarr environment | ||
if (false === (@include '../../main.inc.php')) { // From htdocs directory | ||
require '../../../main.inc.php'; // From "custom" directory | ||
} | ||
|
||
require_once '../core/modules/modZenFusionOAuth.class.php'; | ||
|
@@ -62,7 +55,7 @@ | |
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' | ||
. $langs->trans("BackToModuleList") . '</a>'; | ||
// Folder icon title | ||
print_fiche_titre("ZenFusion", $linkback, 'setup'); | ||
print load_fiche_titre("ZenFusion", $linkback, 'setup'); | ||
|
||
$head = zfPrepareHead(); | ||
|
||
|
@@ -81,7 +74,7 @@ | |
'</h3>'; | ||
echo '<em>', $langs->trans("Version"), ' ', | ||
$module->version, '</em><br>'; | ||
echo '<em>©2011-2014 GPC.solutions<br><em>'; | ||
echo '<em>©2011-2017 GPC.solutions<br><em>'; | ||
echo '<a target="_blank" href="http://www.zenfusion.net/">', | ||
'<img src="../img/logo_zf.png" alt="Logo ZenFusion"></a>'; | ||
|
||
|
@@ -112,18 +105,18 @@ | |
echo '<h4>' . $langs->trans("Libraries") . '</h4>'; | ||
echo '<ul>', | ||
'<li>', | ||
'<a href="https://code.google.com/p/google-api-php-client/" target="_blank">', | ||
'<a href="https://github.com/google/google-api-php-client" target="_blank">', | ||
'Google APIs Client Library for PHP', | ||
'</a>', | ||
'<br>', | ||
'©2008-2014 Google Inc.', | ||
'©2008-2016 Google Inc.', | ||
'<br>', | ||
'Apache License 2.0', | ||
'<br>', | ||
$langs->trans("Contains"), | ||
'<ul>', | ||
'<li>', | ||
'<a href="http://code.google.com/p/diso/" target="_blank">', | ||
'<a href="https://github.com/diso/diso" target="_blank">', | ||
'XRDS-Simple library', | ||
'</a>', | ||
'<br>', | ||
|
@@ -136,7 +129,7 @@ | |
'ZeroClipboard', | ||
'</a>', | ||
'<br>', | ||
'©2014 Jon Rohan, James M. Greene', | ||
'©2009-2016 Jon Rohan, James M. Greene', | ||
'<br>', | ||
'MIT License', | ||
'<br>', | ||
|
@@ -160,7 +153,9 @@ | |
'Trademark Pending', | ||
'</li>', | ||
'<li>GPC.solutions logo<br>', | ||
'©2010-2014 GPC.solutions', | ||
'©2010-2017 GPC.solutions', | ||
'</li>', | ||
'</ul>'; | ||
|
||
dol_fiche_end(); | ||
llxFooter(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/* | ||
* ZenFusion OAuth - A Google OAuth authentication module for Dolibarr | ||
* Copyright (C) 2011 Sebastien Bodrero <[email protected]> | ||
* Copyright (C) 2011-2014 Raphaël Doursenaud <[email protected]> | ||
* Copyright (C) 2011-2016 Raphaël Doursenaud <[email protected]> | ||
* Copyright (C) 2012 Cédric Salvador <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
|
@@ -24,17 +24,10 @@ | |
* \ingroup zenfusionoauth | ||
* Module configuration page | ||
*/ | ||
$res = 0; | ||
// from standard dolibarr install | ||
if (!$res && file_exists('../../main.inc.php')) { | ||
$res = @include '../../main.inc.php'; | ||
} | ||
// from custom dolibarr install | ||
if (!$res && file_exists('../../../main.inc.php')) { | ||
$res = @include '../../../main.inc.php'; | ||
} | ||
if (!$res) { | ||
die("Main include failed"); | ||
|
||
// Load Dolibarr environment | ||
if (false === (@include '../../main.inc.php')) { // From htdocs directory | ||
require '../../../main.inc.php'; // From "custom" directory | ||
} | ||
|
||
require_once '../lib/admin.lib.php'; | ||
|
@@ -52,16 +45,17 @@ | |
|
||
// Build javascript origin URI | ||
$javascript_origin = 'http'; | ||
if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'on') { // HTTPS? | ||
// HTTPS support | ||
if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'on') { | ||
$javascript_origin .= 's'; | ||
} | ||
$javascript_origin .= '://'; | ||
$javascript_origin .= $_SERVER['HTTP_HOST']; | ||
if ( | ||
array_key_exists('SERVER_PORT' ,$_SERVER) | ||
$javascript_origin .= $_SERVER['SERVER_NAME']; | ||
if (array_key_exists('SERVER_PORT', $_SERVER) | ||
&& $_SERVER['SERVER_PORT'] != 80 // Standard HTTP | ||
&& $_SERVER['SERVER_PORT'] != 443 // Standard HTTPS | ||
) { // Non standard port? | ||
) { | ||
// Add non standard port | ||
$javascript_origin .= ':' . $_SERVER['SERVER_PORT']; | ||
} | ||
|
||
|
@@ -84,20 +78,18 @@ | |
if ($action == 'upload') { | ||
$file = file_get_contents($_FILES['jsonConfig']['tmp_name']); | ||
$params = json_decode($file, true); | ||
// TODO: write a file verification function to have better error messages for each case | ||
if ( | ||
$params === null || | ||
! in_array($callback_url, $params['web']['redirect_uris']) || | ||
! in_array($javascript_origin, $params['web']['javascript_origins']) | ||
) { | ||
$error++; | ||
// Check file is valid | ||
if ($params === null) { | ||
$mesg = '<div class="error">' . $langs->trans("BadOrEmptyFile") . '</div>'; | ||
} elseif (!in_array($callback_url, $params['web']['redirect_uris'])) { | ||
$mesg = '<div class="error">' . $langs->trans("WrongOrMissingRedirectURI", $callback_url) . '</div>'; | ||
} elseif (!in_array($javascript_origin, $params['web']['javascript_origins'])) { | ||
$mesg = '<div class="error">' . $langs->trans("WrongOrMissingJSOrigin", $javascript_origin) . '</div>'; | ||
} else { | ||
// File OK | ||
$client_id = $params['web']['client_id']; | ||
$client_secret = $params['web']['client_secret']; | ||
} | ||
if ($error) { | ||
$mesg = '<div class="error">' . $langs->trans("BadFile") . '</div>'; | ||
} | ||
} | ||
|
||
if ($action == 'update') { | ||
|
@@ -146,12 +138,13 @@ | |
* view | ||
*/ | ||
llxHeader(); | ||
dol_htmloutput_mesg($msg); | ||
// Error / confirmation messages | ||
dol_htmloutput_mesg($mesg); | ||
$form = new Form($db); | ||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' | ||
. $langs->trans("BackToModuleList") . '</a>'; | ||
// Folder icon title | ||
print_fiche_titre("ZenFusion", $linkback, 'setup'); | ||
print load_fiche_titre("ZenFusion", $linkback, 'setup'); | ||
|
||
$head = zfPrepareHead(); | ||
dol_fiche_head( | ||
|
@@ -162,14 +155,10 @@ | |
'oauth@zenfusionoauth' | ||
); | ||
|
||
// Error / confirmation messages | ||
dol_htmloutput_mesg($mesg); | ||
|
||
print_titre($langs->trans("GoogleApiConfig")); | ||
print load_fiche_titre($langs->trans("GoogleApiConfig")); | ||
|
||
// Import configuration from google's api console json file | ||
echo '<p>', | ||
$langs->trans("Instructions1"); | ||
echo $langs->trans("Instructions1"); | ||
// TODO: derive table from installed modules | ||
echo '<table class="border"> | ||
<tr class="liste_titre"> | ||
|
@@ -184,7 +173,7 @@ | |
<td>ZenFusion Drive</td> | ||
<td>Drive API<br>Google Picker API</td> | ||
</tr> | ||
<table> | ||
</table> | ||
<br>'; | ||
echo $langs->trans("Instructions2"); | ||
echo zfInitCopyToClipboardButton(); | ||
|
@@ -217,10 +206,9 @@ | |
'</fieldset>', | ||
'</form>', | ||
'<br>'; | ||
echo $langs->trans("Instructions4"), | ||
'</p>'; | ||
echo $langs->trans("Instructions4"); | ||
|
||
print_titre($langs->trans("ManualConfiguration")); | ||
print load_fiche_titre($langs->trans("ManualConfiguration")); | ||
|
||
echo '<form method="POST" action="', $_SERVER['PHP_SELF'], '">', | ||
'<input type="hidden" name="token" value="', $_SESSION['newtoken'], '">', | ||
|
@@ -244,4 +232,5 @@ | |
'</table>', | ||
'</form>'; | ||
|
||
dol_fiche_end(); | ||
llxFooter(); |
Oops, something went wrong.