LDAPAccountManager/lam/templates/config/conflogin.php

153 lines
4.4 KiB
PHP
Raw Normal View History

<?php
2017-11-04 09:49:28 +00:00
namespace LAM\CONFIG;
use \htmlStatusMessage;
use \htmlResponsiveRow;
use \LAMCfgMain;
use \htmlButton;
use \htmlOutputText;
use \htmlLink;
use \htmlDiv;
use \htmlResponsiveSelect;
use \htmlResponsiveInputField;
use \htmlHorizontalLine;
2003-02-25 21:28:17 +00:00
/*
2009-10-27 18:47:12 +00:00
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
2018-03-10 17:48:11 +00:00
Copyright (C) 2003 - 2018 Roland Gruber
2003-02-25 21:28:17 +00:00
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.
2003-05-09 16:22:46 +00:00
2003-02-25 21:28:17 +00:00
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.
2003-07-06 10:24:41 +00:00
2003-02-25 21:28:17 +00:00
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2004-06-02 12:48:54 +00:00
*/
2003-06-04 18:47:40 +00:00
2004-06-02 12:48:54 +00:00
/**
* Login page to change the preferences.
*
* @package configuration
* @author Roland Gruber
2003-02-25 21:28:17 +00:00
*/
2003-03-23 18:38:47 +00:00
2004-06-02 12:48:54 +00:00
/** Access to config functions */
2003-07-06 10:24:41 +00:00
include_once('../../lib/config.inc');
2004-06-02 12:48:54 +00:00
/** Used to print status messages */
2003-07-06 10:24:41 +00:00
include_once('../../lib/status.inc');
2003-03-23 18:38:47 +00:00
// start session
2009-07-08 18:03:28 +00:00
if (strtolower(session_module_name()) == 'files') {
2010-02-06 11:50:26 +00:00
session_save_path(dirname(__FILE__) . '/../../sess');
2009-07-08 18:03:28 +00:00
}
2018-03-10 17:48:11 +00:00
lam_start_session();
2010-02-06 11:50:26 +00:00
session_regenerate_id(true);
2003-05-28 21:44:41 +00:00
2003-07-06 17:54:11 +00:00
setlanguage();
2017-11-05 09:49:33 +00:00
$message = null;
// get error message from confmain.php
2017-11-04 09:49:28 +00:00
if (isset($_SESSION['conf_message'])) {
$message = $_SESSION['conf_message'];
}
2003-07-15 17:30:12 +00:00
// remove settings from session
2006-01-01 16:30:05 +00:00
$sessionKeys = array_keys($_SESSION);
for ($i = 0; $i < sizeof($sessionKeys); $i++) {
if (substr($sessionKeys[$i], 0, 5) == "conf_") unset($_SESSION[$sessionKeys[$i]]);
}
2003-07-15 17:30:12 +00:00
2003-07-29 11:52:26 +00:00
echo $_SESSION['header'];
2003-05-28 21:44:41 +00:00
2016-10-09 08:59:43 +00:00
$files = getConfigProfiles();
2017-11-04 09:49:28 +00:00
printHeaderContents(_("Login"), '../..');
2003-02-25 21:28:17 +00:00
2017-11-04 09:49:28 +00:00
if (sizeof($files) < 1) {
$message = new htmlStatusMessage('INFO', _("No server profiles found. Please create one."));
}
$tabindex = 1;
?>
2003-02-25 21:28:17 +00:00
</head>
2017-11-04 09:49:28 +00:00
<body class="admin">
2005-06-28 15:46:41 +00:00
<?php
2017-11-04 09:49:28 +00:00
printJsIncludes('../..');
2010-10-11 17:52:30 +00:00
?>
2010-08-31 18:05:17 +00:00
<table border=0 width="100%" class="lamHeader ui-corner-all">
2010-07-30 16:08:20 +00:00
<tr>
<td align="left" height="30">
2014-03-29 11:04:14 +00:00
<a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a>
2010-07-30 16:08:20 +00:00
</td>
</tr>
</table>
<br><br>
2003-07-06 10:24:41 +00:00
<!-- form to change existing profiles -->
2014-02-20 17:14:22 +00:00
<form action="confmain.php" method="post" autocomplete="off">
2017-11-04 09:49:28 +00:00
<?php
$row = new htmlResponsiveRow();
// message
if ($message !== null) {
$row->add($message, 12);
$row->addVerticalSpacer('2rem');
}
$box = new htmlResponsiveRow();
if (sizeof($files) > 0) {
$box->add(new htmlOutputText(_("Please enter your password to change the server preferences:")), 12);
$box->addVerticalSpacer('1.5rem');
$conf = new LAMCfgMain();
$selectedProfile = array();
$profilesExisting = false;
$profiles = $files;
if (!empty($_COOKIE["lam_default_profile"]) && in_array($_COOKIE["lam_default_profile"], $files)) {
$selectedProfile[] = $_COOKIE["lam_default_profile"];
}
else {
$selectedProfile[] = $conf->default;
}
$box->add(new htmlResponsiveSelect('filename', $profiles, $selectedProfile, _('Profile name')), 12);
$passwordInput = new htmlResponsiveInputField(_('Password'), 'passwd', '', '200');
$passwordInput->setIsPassword(true);
2017-11-24 18:22:11 +00:00
$passwordInput->setCSSClasses(array('lam-initial-focus'));
2017-11-04 09:49:28 +00:00
$box->add($passwordInput, 12);
$box->addVerticalSpacer('1rem');
$button = new htmlButton('submit', _("Ok"));
$box->addLabel($button);
$box->add(new htmlOutputText(''), 0, 6);
$box->addVerticalSpacer('1.5rem');
$box->add(new htmlHorizontalLine(), 12);
$box->addVerticalSpacer('1.5rem');
}
2017-11-11 14:12:43 +00:00
$manageLink = new htmlLink(_("Manage server profiles"), 'profmanage.php', '../../graphics/tools.png');
$box->add($manageLink, 12, 12, 12, 'text-center');
2017-11-04 09:49:28 +00:00
$boxDiv = new htmlDiv(null, $box);
2017-11-04 14:09:29 +00:00
$boxDiv->setCSSClasses(array('ui-corner-all', 'roundedShadowBox', 'limitWidth', 'text-center'));
2017-11-04 09:49:28 +00:00
$row->add($boxDiv, 12);
// back link
$row->addVerticalSpacer('2rem');
$backLink = new htmlLink(_("Back to login"), '../login.php', '../../graphics/undo.png');
$row->add($backLink, 12, 12, 12, 'text-left');
2017-11-04 14:09:29 +00:00
parseHtml(null, new htmlDiv(null, $row, array('centeredTable')), array(), false, $tabindex, 'user');
2017-11-04 09:49:28 +00:00
?>
2003-02-25 21:28:17 +00:00
</form>
2003-07-06 10:24:41 +00:00
2010-07-30 16:08:20 +00:00
<p><br><br></p>
2003-07-06 10:24:41 +00:00
2003-02-25 21:28:17 +00:00
</body>
</html>