Verified Commit 73ee090f authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(invitations) Add pages for invitation and private forms

Invitation page template is just a placeholder for now

issue #5850
Showing with 152 additions and 0 deletions
+152 -0
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2018 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once('../include/php_setup.inc');
require_once('functions.inc');
require_once('variables.inc');
invitationPage::run();
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2018 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
require_once('../include/php_setup.inc');
require_once('functions.inc');
require_once('variables.inc');
// Private form code is the same as public code, only difference is this endpoint will be behind SSO
publicFormPage::run();
<body onLoad="javascript:$$('div.debug_div').each(function (a) { a.hide(); });">
{* FusionDirectory public form - smarty template *}
{$php_errors}
{$msg_dialogs}
<div id="window-container">
<div id="window-div">
<form action="" name="mainform" id="mainform" method="post" enctype="multipart/form-data">
<div id="window-titlebar">
<img id="fd-logo" src="geticon.php?context=applications&amp;icon=fusiondirectory&amp;size=48" alt="FusionDirectory"/>
<p>
Invitation
</p>
</div>
<div id="window-content">
<div>
<p class="infotext">
Hello.
<a href="/privateform.php?token={$token|escape}">Click here to connect</a>
<a href="/publicform.php?token={$token|escape}">Click here if you fail to connect</a>
</p>
</div>
</div>
<input type="hidden" name="CSRFtoken" value="{$CSRFtoken}"/>
</form>
</div>
</div>
<script type="text/javascript">
<!-- // Error Popup
next_msg_dialog();
-->
</script>
</body>
</html>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2017-2018 FusionDirectory
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class invitationPage extends standAlonePage
{
protected $token;
function readLdapConfig()
{
global $config;
return TRUE;
}
function save_object()
{
global $ui;
if (!$this->activated) {
return;
}
if (isset($_GET['token'])) {
$this->token = $_GET['token'];
}
}
function execute()
{
if (!$this->activated) {
return;
}
$this->save_object();
$smarty = get_smarty();
$this->assignSmartyVars();
$smarty->append('css_files', get_template_path('login.css'));
$smarty->display(get_template_path('headers.tpl'));
$smarty->assign('activated', $this->activated);
$smarty->assign('token', $this->token);
$smarty->display(get_template_path('invitation.tpl'));
}
}
?>
  • SonarQube analysis reported 3 issues

    • :information_source: 3 info

    Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

    1. :information_source: Complete the task associated to this "TODO" comment. :blue_book:
    2. :information_source: Complete the task associated to this "TODO" comment. :blue_book:
    3. :information_source: Complete the task associated to this "TODO" comment. :blue_book:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment