function getMailer() { // Choose mail transport method; either smtp or sendmail $mail_method = get_config('mail_method'); $crypto = new \Elabftw\Elabftw\CryptoWrapper(); switch ($mail_method) { // Use SMTP Server case 'smtp': $transport = Swift_SmtpTransport::newInstance(get_config('smtp_address'), get_config('smtp_port'), get_config('smtp_encryption'))->setUsername(get_config('smtp_username'))->setPassword($crypto->decrypt(get_config('smtp_password'))); break; // Use php mail function // Use php mail function case 'php': $transport = Swift_MailTransport::newInstance(); break; // Use locally installed MTA (aka sendmail); Default // Use locally installed MTA (aka sendmail); Default default: $transport = Swift_SendmailTransport::newInstance(get_config('sendmail_path') . ' -bs'); break; } $mailer = Swift_Mailer::newInstance($transport); return $mailer; }
* @license AGPL-3.0 * @package elabftw */ /** * Administrate elabftw install * */ require_once 'inc/common.php'; if ($_SESSION['is_sysadmin'] != 1) { die(_('This section is out of your reach.')); } $page_title = _('eLabFTW configuration'); $selected_menu = null; require_once 'inc/head.php'; $formKey = new \Elabftw\Elabftw\FormKey(); $crypto = new \Elabftw\Elabftw\CryptoWrapper(); $stamppass = get_config('stamppass'); $smtppass = get_config('smtp_password'); if (strlen($stamppass) > 0) { try { $stamppass = $crypto->decrypt($stamppass); } catch (Exception $e) { display_message('error', $e->getMessage()); } } if (strlen($smtppass) > 0) { try { $smtppass = $crypto->decrypt($smtppass); } catch (Exception $e) { display_message('error', $e->getMessage()); }
* but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * * PURPOSE. See the GNU Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public * * License along with eLabFTW. If not, see <http://www.gnu.org/licenses/>. * * * ********************************************************************************/ /* sysconfig-exec.php - for the sysadmin */ require_once '../inc/common.php'; // only sysadmin can use this if ($_SESSION['is_sysadmin'] != 1 || $_SERVER['REQUEST_METHOD'] != 'POST') { die(_('This section is out of your reach.')); } $sysconfig = new \Elabftw\Elabftw\SysConfig(); $crypto = new \Elabftw\Elabftw\CryptoWrapper(); $msg_arr = array(); $errflag = false; $tab = '1'; // TAB 1 : ADD A NEW TEAM if (isset($_POST['new_team']) && $_POST['new_team'] != '' && $_POST['new_team'] != ' ') { $tab = '1'; $new_team_name = filter_var($_POST['new_team'], FILTER_SANITIZE_STRING); if (!$sysconfig->addTeam($new_team_name)) { $errflag = true; $errnum = '5'; } } // END TAB 1 // TAB 2 : SERVER if (isset($_POST['lang'])) {
* it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or (at your option) any eLabFTWlater version. * * * * eLabFTW 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 Affero General Public License for more details. * * * * You should have received a copy of the GNU Affero General Public * * License along with eLabFTW. If not, see <http://www.gnu.org/licenses/>. * * * ********************************************************************************/ require_once '../inc/common.php'; $user = new \Elabftw\Elabftw\User(); $crypto = new \Elabftw\Elabftw\CryptoWrapper(); $errflag = false; /* * FIRST PART * * We send an email with a link + a key + the userid. * */ if (isset($_POST['email'])) { // Get infos about the requester (will be sent in the mail afterwards) // Get IP if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else {
* @copyright 2012 Nicolas CARPi * @see http://www.elabftw.net Official website * @license AGPL-3.0 * @package elabftw */ /** * Administration of a team * */ require_once 'inc/common.php'; // only admin can use this if ($_SESSION['is_admin'] != 1) { die(_('This section is out of your reach.')); } $formKey = new \Elabftw\Elabftw\FormKey(); $crypto = new \Elabftw\Elabftw\CryptoWrapper(); $page_title = _('Admin panel'); $selected_menu = null; require_once 'inc/head.php'; ?> <script src="js/tinymce/tinymce.min.js"></script> <link href="js/colorpicker/jquery.colorpicker.css" rel="stylesheet" type="text/css" /> <?php // MAIN SQL FOR USERS $sql = "SELECT * FROM users WHERE validated = :validated AND team = :team"; $user_req = $pdo->prepare($sql); $user_req->bindValue(':validated', 0); $user_req->bindValue(':team', $_SESSION['team_id']); $user_req->execute(); $count = $user_req->rowCount(); // only show the frame if there is some users to validate and there is an email config