<input type='text' value='<?php echo get_team_config('stamplogin'); ?> ' name='stamplogin' id='stamplogin' /> <span class='smallgray'><?php echo _('This should be the login associated with your timestamping service provider'); ?> </span> </p> <p> <label for='stamppass'><?php echo _('Password for external timestamping service:'); ?> </label> <input type='password' value='<?php echo $crypto->decrypt(get_team_config('stamppass')); ?> ' name='stamppass' id='stamppass' /> <span class='smallgray'><?php echo _('Your timestamping service provider password'); ?> </span> </p> <div class='center'> <button type='submit' name='submit_config' class='submit button'>Save</button> </div> </form> </div> <!-- TABS 2 -->
echo "<a href='database.php?mode=show'"; if ($selected_menu == 'Database') { echo " class='selected'"; } echo ">" . _('Database') . "</a> "; echo "<a href='team.php'"; if ($selected_menu == 'Team') { echo " class='selected'"; } echo ">" . _('Team') . "</a> "; echo "<a href='search.php'"; if ($selected_menu == 'Search') { echo " class='selected'"; } echo ">" . _('Search') . "</a> "; echo "<a href='" . get_team_config('link_href') . "' target='_blank'>" . get_team_config('link_name') . "</a>"; echo "</nav>"; } else { // not logged in, show only logo, no menu echo "<nav><span id='logonav' class='navleft'>elab<strong>FTW</strong></span></nav>"; } ?> <div id='real_container'> <?php if (isset($_SESSION['auth'])) { ?> <div> <?php echo _('Howdy,') . ' '; ?> <a href='profile.php' title='<?php
/** * Return the needed parameters to request/verify a timestamp * * @return array<string,string|null> */ function getTimestampParameters() { $hash_algorithms = array('sha256', 'sha384', 'sha512'); $crypto = new \Elabftw\Elabftw\Crypto(); if (strlen(get_team_config('stamplogin')) > 2) { $login = get_team_config('stamplogin'); $password = $crypto->decrypt(get_team_config('stamppass')); $provider = get_team_config('stampprovider'); $cert = get_team_config('stampcert'); $hash = get_team_config('stamphash'); if (!in_array($hash, $hash_algorithms)) { $hash = 'sha256'; } } elseif (get_config('stampshare')) { $login = get_config('stamplogin'); $password = $crypto->decrypt(get_config('stamppass')); $provider = get_config('stampprovider'); $cert = get_config('stampcert'); $hash = get_config('stamphash'); if (!in_array($hash, $hash_algorithms)) { $hash = 'sha256'; } // otherwise assume no login or password is needed } else { throw new Exception(_('No valid credentials were found for Time Stamping.')); exit; } return array('stamplogin' => $login, 'stamppassword' => $password, 'stampprovider' => $provider, 'stampcert' => $cert, 'hash' => $hash); }
?> </li> <li class='tabhandle' id='tab3'><?php echo _('Tools'); ?> </li> <li class='tabhandle' id='tab4'><?php echo _('Help'); ?> </li> </ul> </menu> <!-- *********************** --> <div class='divhandle' id='tab1div'> <?php display_message('info_nocross', sprintf(_('You belong to the %s team.'), get_team_config('team_name'))); ?> <table id='teamtable' class='table'> <tr> <th><?php echo _('Name'); ?> </th> <th><?php echo _('Phone'); ?> </th> <th><?php echo _('Mobile'); ?> </th>
/** * Return the needed parameters to request/verify a timestamp * * @return array<string,string> */ public function getTimestampParameters() { $crypto = new Crypto(); $hash_algorithms = array('sha256', 'sha384', 'sha512'); // if there is a config in the team, use that // otherwise use the general config if we can if (strlen(get_team_config('stampprovider')) > 2) { $config = get_team_config(); } elseif (get_config('stampshare')) { $config = get_config(); } else { throw new Exception(_('Please configure Timestamping in the admin panel.')); } $login = $config['stamplogin']; if (strlen($config['stamppass']) > 0) { $password = $crypto->decrypt($config['stamppass']); } else { $password = ''; } $provider = $config['stampprovider']; $cert = $config['stampcert']; $hash = $config['stamphash']; if (!in_array($hash, $hash_algorithms)) { $hash = 'sha256'; } return array('stamplogin' => $login, 'stamppassword' => $password, 'stampprovider' => $provider, 'stampcert' => $cert, 'hash' => $hash); }
// This page is called with POST requests containing an id and a type. require_once '../inc/common.php'; require_once ELAB_ROOT . 'inc/locale.php'; // Check id is valid and assign it to $id if (isset($_POST['id']) && is_pos_int($_POST['id'])) { $id = $_POST['id']; } else { die(sprintf(_("There was an unexpected problem! Please %sopen an issue on GitHub%s if you think this is a bug."), "<a href='https://github.com/elabftw/elabftw/issues/'>", "</a>")); } // Item switch if (isset($_POST['type']) && !empty($_POST['type'])) { switch ($_POST['type']) { // EXPERIMENTS case 'exp': // check if we can delete experiments if (get_team_config('deletable_xp') == '0' && !$_SESSION['is_admin'] || !is_owned_by_user($id, 'experiments', $_SESSION['userid'])) { $msg_arr[] = _("You don't have the rights to delete this experiment."); $_SESSION['errors'] = $msg_arr; exit; } else { // delete the experiment $sql = "DELETE FROM experiments WHERE id = :id"; $req = $pdo->prepare($sql); $req->execute(array('id' => $id)); // delete associated tags $sql = "DELETE FROM experiments_tags WHERE item_id = :id"; $req = $pdo->prepare($sql); $req->execute(array('id' => $id)); // delete associated files $sql = "SELECT id, real_name, long_name FROM uploads WHERE item_id = :id AND type = :type"; $req = $pdo->prepare($sql);
$count = $user_req->rowCount(); // only show the frame if there is some users to validate and there is an email config if ($count > 0 && strlen(get_config('mail_from')) > 0) { $message = _('There are users waiting for validation of their account:'); $message .= "<form method='post' action='app/admin-exec.php'>"; $message .= $formKey->getFormkey(); $message .= "<ul>"; while ($data = $user_req->fetch()) { $message .= "<li><label>\n <input type='checkbox' name='validate[]'\n value='" . $data['userid'] . "'> " . $data['firstname'] . " " . $data['lastname'] . " (" . $data['email'] . ")\n </label></li>"; } $message .= "</ul><div class='center'>\n <button class='button' type='submit'>" . _('Submit') . "</button></div>"; display_message('error', $message); echo "</form>"; } // get the team config $team = get_team_config(); $stamppass = ''; if (!empty($team['stamppass'])) { try { $stamppass = $crypto->decrypt($team['stamppass']); } catch (Exception $e) { $stamppass = ''; } } ?> <menu> <ul> <li class='tabhandle' id='tab1'><?php echo _('Team');