Commit 50e56a03 authored by Yannick François's avatar Yannick François

Récupère l'ancien framadate

à la racine, quand on lance le serveur, on a le framadate tel qu'il est aujourd'hui

en ajoutant  sur l'url, on accède à la maquette interactive dans son état actuel
parent b1ab16bd
Pipeline #91791 passed with stage
in 1 minute and 13 seconds
tpl_c/*.php
vendor/
po/*.po
po/*.json
######################
# .htaccess example. #
######################
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule ^([a-zA-Z0-9-]+)$ studs.php?poll=$1 [L]
RewriteRule ^([a-zA-Z0-9-]+)/action/([a-zA-Z_-]+)/(.+)$ studs.php?poll=$1&$2=$3
RewriteRule ^([a-zA-Z0-9-]+)/vote/([a-zA-Z0-9]{16})$ studs.php?poll=$1&vote=$2
RewriteRule ^([a-zA-Z0-9-]{24})/admin$ adminstuds.php?poll=$1
RewriteRule ^([a-zA-Z0-9-]{24})/admin/vote/([a-zA-Z0-9]{16})$ adminstuds.php?poll=$1&vote=$2
RewriteRule ^([a-zA-Z0-9-]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$ adminstuds.php?poll=$1&$2=$4
</IfModule>
\ No newline at end of file
# [Framasoft](http://framadate.org)
* Simon Leblanc (development),
* Pierre-Yves Gosset (development, graphism)
* Pascal Chevrel (development)
* Armony Altinier (accessibility)
* JosephK (development)
* Framasoft community
*For a list of people who have contributed to the codebase, see [GitHub's list of contributors](https://github.com/framasoft/OpenSondage/graphs/contributors).*
## [STUdS](http://studs.u-strasbg.fr)
* Guilhem Borghesi (borghesi@unistra.fr)
* Raphaël Droz
* Contributors from the University of Strasbourg: Guy, Christophe, Julien, Pierre, Romaric, Matthieu, Catherine, Christine, Olivier, Emmanuel and Florence
This diff is collapsed.
# Contributing
Please report issues on <https://framagit.org/framasoft/framadate/issues>
If you made a change and want it to be available in official repository, merge requests are welcome!
Read the [guidelines](https://framagit.org/framasoft/framadate/wikis/coding) to submit your changes.
\ No newline at end of file
# [Now available here](https://framagit.org/framasoft/framadate/wikis/home)
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
locales:
scripts/locales.sh
push-locales: locales
zanata-cli -q -B push --errors --project-version `git branch | grep \* | cut -d ' ' -f2-`
pull-locales:
zanata-cli -q -B pull --min-doc-percent 50 --project-version `git branch | grep \* | cut -d ' ' -f2-`
scripts/po2json.sh
stats-locales:
zanata-cli -q stats --project-version `git branch | grep \* | cut -d ' ' -f2-`
push-trad-to-zanata:
scripts/push-trad-to-zanata.sh $(filter-out $@,$(MAKECMDGOALS))
add-key-locales:
scripts/locale-add-key.pl "$(subst ",\",$(filter-out $@,$(MAKECMDGOALS)))"
# empty targets to be able to use MAKECMDGOALS as arguments to scripts
%:
@:
![Build Status](https://gitlab.com/pages/plain-html/badges/master/build.svg)
# Framadate
![English](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Flag_of_the_United_Kingdom.svg/20px-Flag_of_the_United_Kingdom.svg.png) Framadate is an online service for planning an appointment or making a decision quickly and easily. No registration is required.
![Français](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Flag_of_France.svg/20px-Flag_of_France.svg.png) Framadate est un service en ligne permettant de planifier un rendez-vous ou prendre des décisions rapidement et simplement. Aucune inscription préalable n’est nécessaire.
---
# Installation
Follow the instructions on our Wiki : <https://framagit.org/framasoft/framadate/wikis/home>
# Contribute
## Code
Follow the instructions on <https://framagit.org/framasoft/framadate/wikis/coding>
# Traductions
Follow the instructions on <https://framagit.org/framasoft/framadate/wikis/translating>
# Used libraries
* PHP [PHP 5.6](http://php.net)
* Templating [Smarty](http://www.smarty.net/),
* I18N [o80-i18n](https://github.com/olivierperez/o80-i18n)
* Database: PostgreSQL ou [MySQL 5.5](https://dev.mysql.com/downloads/mysql/5.5.html)
---
Basé sur un l'exemple de publication de pages sur Gitlab, voici quelques pages permettant d'explorer une nouvelle version du formulaire de création de [Framadate](https://framadate.org).
Framadate is a fork of the [STUdS](https://sourcesup.cru.fr/projects/studs/) project, that works at framadate.org for framasoft.org
Previous main authors of Framadate were :
* Simon LEBLANC
* Pierre-Yves GOSSET
Pour voir là où nous en somme :
Main authors of project STUdS are :
* Guilhem BORGHESI
* Raphaël DROZ
https://funky.framadate.org/
---
Université de Strasbourg - Direction Informatique
Auteur : Guilhem BORGHESI
Création : Février 2008
## Développement
borghesi@unistra.fr
Nous travaillons sur la base des [maquettes](https://sketch.cloud/s/bavo4/all/cration-de-sondage/1-accueil/play) réalisé par Maïwann.
Le principe se base sur un formulaire « textuel », aussi appelé [Natural Language Form](https://tympanus.net/Tutorials/NaturalLanguageForm/)
Ce logiciel est régi par la licence CeCILL-B soumise au droit français et
respectant les principes de diffusion des logiciels libres. Vous pouvez
utiliser, modifier et/ou redistribuer ce programme sous les conditions
de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA
sur le site "http://www.cecill.info".
Pour lancer executer le projet sur sa propre machine :
Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
pris connaissance de la licence CeCILL-B, et que vous en avez accepté les
termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE.
Cloner le projet
---
```sh
git clone https://framagit.org/yaf/funky-framadate-front
```
Université de Strasbourg - Direction Informatique
Author : Guilhem BORGHESI
Creation : Feb 2008
```sh
./dev
```
borghesi@unistra.fr
Le formulaire devrait être visible sur l'url http://locahost:8080
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL-B
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-B license and that you accept its terms. You can
find a copy of this license in the file LICENSE.
---
Janvier 2008
Guilhem BORGHESI
Université de Strasbourg
Mai 2010
Raphaël DROZ, raphael.droz@gmail.com
<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondage: Framasoft (https://github.com/framasoft)
*
* =============================
*
* Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
*
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
use Framadate\Message;
use Framadate\Services\InputService;
use Framadate\Services\LogService;
use Framadate\Services\MailService;
use Framadate\Services\NotificationService;
use Framadate\Services\PollService;
use Framadate\Services\SecurityService;
include_once __DIR__ . '/../app/inc/init.php';
/* Variables */
/* --------- */
$poll_id = null;
$poll = null;
$message = null;
$result = false;
$comments = [];
$is_admin = false;
/* Services */
/*----------*/
$logService = new LogService();
$pollService = new PollService($connect, $logService);
$inputService = new InputService();
$mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
$notificationService = new NotificationService($mailService);
$securityService = new SecurityService();
/* PAGE */
/* ---- */
if (!empty($_POST['poll'])) {
$poll_id = filter_input(INPUT_POST, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
$poll = $pollService->findById($poll_id);
}
if (!empty($_POST['poll_admin'])) {
$admin_poll_id = filter_input(INPUT_POST, 'poll_admin', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
if (strlen($admin_poll_id) === 24) {
$is_admin = ($pollService->findByAdminId($admin_poll_id) !== null);
}
}
if (!$poll) {
$message = new Message('error', __('Error', "This poll doesn't exist!"));
} else if ($poll && !$securityService->canAccessPoll($poll) && !$is_admin) {
$message = new Message('error', __('Password', 'Wrong password'));
} else {
$name = $inputService->filterName($_POST['name']);
$comment = $inputService->filterComment($_POST['comment']);
if ($name === null) {
$message = new Message('danger', __('Error', 'The name is invalid.'));
}
if ($message === null) {
// Add comment
$result = $pollService->addComment($poll_id, $name, $comment);
if ($result) {
$message = new Message('success', __('Comments', 'Comment saved'));
$notificationService->sendUpdateNotification($poll, NotificationService::ADD_COMMENT, $name);
} else {
$message = new Message('danger', __('Error', 'Comment failed'));
}
}
$comments = $pollService->allCommentsByPollId($poll_id);
}
$smarty->error_reporting = E_ALL & ~E_NOTICE;
$smarty->assign('comments', $comments);
$comments_html = $smarty->fetch('part/comments_list.tpl');
$response = ['result' => $result, 'message' => $message, 'comments' => $comments_html];
echo json_encode($response);
<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondage: Framasoft (https://github.com/framasoft)
*
* =============================
*
* Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
*
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
use Framadate\Message;
use Framadate\Services\LogService;
use Framadate\Services\MailService;
use Framadate\Services\PollService;
use Framadate\Services\SessionService;
use Framadate\Utils;
include_once __DIR__ . '/../app/inc/init.php';
$logService = new LogService();
$sessionService = new SessionService();
$mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
$pollService = new PollService($connect, $logService);
$result = false;
$message = null;
$poll = null;
$poll_id = null;
$email = null;
if (!empty($_POST['poll'])) {
$poll_id = filter_input(INPUT_POST, 'poll', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
$poll = $pollService->findById($poll_id);
}
$token = $sessionService->get("Common", SESSION_EDIT_LINK_TOKEN);
$token_form_value = empty($_POST['token']) ? null : $_POST['token'];
$editedVoteUniqueId = filter_input(INPUT_POST, 'editedVoteUniqueId', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => POLL_REGEX]]);
if (is_null($poll) || $config['use_smtp'] === false || is_null($token) || is_null($token_form_value)
|| !$token->check($token_form_value) || is_null($editedVoteUniqueId)) {
$message = new Message('error', __('Error', 'Something has gone wrong...'));
}
if (is_null($message)) {
$email = $mailService->isValidEmail($_POST['email']);
if (is_null($email)) {
$message = new Message('error', __('EditLink', 'The email address is not correct.'));
}
}
if (is_null($message)) {
$time = $sessionService->get("Common", SESSION_EDIT_LINK_TIME);
if (!empty($time)) {
$remainingTime = TIME_EDIT_LINK_EMAIL - (time() - $time);
if ($remainingTime > 0) {
$message = new Message('error', __f('EditLink', 'Please wait %d seconds before we can send an email to you then try again.', $remainingTime));
}
}
}
if (is_null($message)) {
$url = Utils::getUrlSondage($poll_id, false, $editedVoteUniqueId);
$smarty->assign('poll', $poll);
$smarty->assign('poll_id', $poll_id);
$smarty->assign('editedVoteUniqueId', $editedVoteUniqueId);
$body = $smarty->fetch('mail/remember_edit_link.tpl');
$subject = '[' . NOMAPPLICATION . '][' . __('EditLink', 'REMINDER') . '] ' . __f('EditLink', 'Edit link for poll "%s"', $poll->title);
$mailService->send($email, $subject, $body);
$sessionService->remove("Common", SESSION_EDIT_LINK_TOKEN);
$sessionService->set("Common", SESSION_EDIT_LINK_TIME, time());
$message = new Message('success', __('EditLink', 'Your reminder has been successfully sent!'));
$result = true;
}
$smarty->error_reporting = E_ALL & ~E_NOTICE;
$response = ['result' => $result, 'message' => $message];
echo json_encode($response);
admin:$apr1$BskOE5OK$zOMq.fKFNCHkKhBdA12mR/
<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondage: Framasoft (https://github.com/framasoft)
*
* =============================
*
* Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
*
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
use Framadate\Message;
use Framadate\Utils;
define('ROOT_DIR', __DIR__ . '/../');
/**
* Checking for missing vendors.
*/
if (!file_exists(ROOT_DIR . 'vendor/autoload.php') || !file_exists(ROOT_DIR . 'vendor/o80/i18n/src/shortcuts.php')) {
die ("ERROR: You should use <code>composer install</code> to fetch dependant libraries.");
}
/**
* Stripped ini sequence
*/
require_once ROOT_DIR . 'vendor/autoload.php';
require_once ROOT_DIR . 'vendor/o80/i18n/src/shortcuts.php';
require_once ROOT_DIR . 'app/inc/constants.php';
if (session_id() === '') {
session_start();
}
$ALLOWED_LANGUAGES = [
'fr' => 'Français',
'en' => 'English',
'oc' => 'Occitan',
'es' => 'Español',
'de' => 'Deutsch',
'it' => 'Italiano',
'br' => 'Brezhoneg',
];
const DEFAULT_LANGUAGE = 'en';
require_once ROOT_DIR . 'app/inc/i18n.php';
/**
* Function to sort messages by type (priorise errors on warning, warning on info, etc.)
*
* @param Message $a
* @param Message $b
* @return int
*/
function compareCheckMessage(Message $a, Message $b)
{
$values = [
'danger' => 0,
'warning' => 1,
'info' => 2,
'success' => 3
];
$vA = $values[$a->type];
$vB = $values[$b->type];
if ($vA === $vB) {
return 0;
}
return ($vA < $vB) ? -1 : 1;
}
/**
* Vars
*/
$messages = [];
$inc_directory = ROOT_DIR . 'app/inc/';
$conf_filename = $inc_directory . 'config.php';
/**
* Messages
*/
// PHP Version
if (version_compare(PHP_VERSION, PHP_NEEDED_VERSION) >= 0) {
$messages[] = new Message('info', __f('Check','PHP version %s is enough (needed at least PHP %s).', PHP_MAJOR_VERSION . "." . PHP_MINOR_VERSION, PHP_NEEDED_VERSION));
} else {
$messages[] = new Message('danger', __f('Check','Your PHP version (%s) is too old. This application needs at least PHP %s.', phpversion(), PHP_NEEDED_VERSION));
}
// INTL extension
if (extension_loaded('intl')) {
$messages[] = new Message('info', __('Check','PHP Intl extension is enabled.'));
} else {
$messages[] = new Message('danger', __('Check','You need to enable the PHP Intl extension.'));
}
// Is template compile dir exists and writable ?
if (!file_exists(ROOT_DIR . COMPILE_DIR)) {
$messages[] = new Message('danger', __f('Check','The template compile directory (%s) doesn\'t exist in "%s". Retry the installation process.', COMPILE_DIR, realpath(ROOT_DIR)));
} elseif (is_writable(ROOT_DIR . COMPILE_DIR)) {
$messages[] = new Message('info', __f('Check','The template compile directory (%s) is writable.', realpath(ROOT_DIR . COMPILE_DIR)));
} else {
$messages[] = new Message('danger', __f('Check','The template compile directory (%s) is not writable.', realpath(ROOT_DIR . COMPILE_DIR)));
}
// Does config.php exists or is writable ?
if (file_exists($conf_filename)) {
$messages[] = new Message('info', __('Check','The config file exists.'));
} elseif (is_writable($inc_directory)) {
$messages[] = new Message('info', __f('Check','The config file directory (%s) is writable.', $inc_directory));
} else {
$messages[] = new Message('danger', __f('Check','The config file directory (%s) is not writable and the config file (%s) does not exists.', $inc_directory, $conf_filename));
}
// Security
if (extension_loaded('openssl')) {
$messages[] = new Message('info', __('Check','OpenSSL extension loaded.'));
} else {
$messages[] = new Message('warning', __('Check','Consider enabling the PHP extension OpenSSL for increased security.'));
}
if (ini_get('session.cookie_httponly') === '1') {
$messages[] = new Message('info', __('Check', 'Cookies are served from HTTP only.'));
} else {
$messages[] = new Message('warning', __('Check', "Consider setting « session.cookie_httponly = 1 » inside your php.ini or add « php_value session.cookie_httponly 1 » to your .htaccess so that cookies can't be accessed through Javascript."));
}
// Datetime
$timezone = ini_get('date.timezone');
if (!empty($timezone)) {
$messages[] = new Message('info', __('Check','date.timezone is set.'));
} else {
$messages[] = new Message('warning', __('Check','Consider setting the date.timezone in php.ini.'));
}
// The percentage of steps needed to be ready to launch the application
$errors = 0;
$warnings = 0;
foreach ($messages as $message) {
if ($message->type === 'danger') {
$errors++;
} else if ($message->type === 'warning') {
$warnings++;
}
}
$readyPercentage = round((count($messages)-$errors)*100/count($messages));
if ($errors > 0) {
$readyClass = 'danger';
} else if ($warnings > 0) {
$readyClass = 'warning';
} else {
$readyClass = 'success';
}
usort($messages, 'compareCheckMessage');
?>
<!DOCTYPE html>
<html lang="<?=$locale?>">
<head>
<meta charset="utf-8">
<title><?=__('Check', 'Installation checking') ?></title>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/frama.css">
</head>
<body>
<div class="container ombre">
<div class="row">
<form method="get" action="" class="hidden-print">
<div class="input-group input-group-sm pull-right col-xs-12 col-sm-2">
<select name="lang" class="form-control" title="<?=__('Language selector', 'Select language')?>" >
<?php foreach ($ALLOWED_LANGUAGES as $lang_key => $language) { ?>
<option lang="fr" <?php if (substr($lang_key, 0, 2)===$locale) { echo 'selected';} ?> value="<?=substr($lang_key, 0, 2)?>"><?=$language?></option>
<?php } ?>
</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-default btn-sm" title="<?=__('Language selector', 'Select language')?>">OK</button>
</span>
</div>
</form>
</div>
<div class="row">
<div class="col-md-12">
<h1><?=__('Check', 'Installation checking') ?></h1>
<div>
<div class="progress">
<div class="progress-bar progress-bar-<?= $readyClass ?>" role="progressbar" aria-valuenow="<?= $readyPercentage ?>" aria-valuemin="0" aria-valuemax="100" style="width: <?= $readyPercentage ?>%;">
<?= $readyPercentage ?>%
</div>
</div>
</div>
<div>
<?php
foreach ($messages as $message) {
echo '<div class="alert alert-' . $message->type . '" role="alert">';
echo Utils::htmlEscape($message->message);
echo '<span class="sr-only">' . $message->type . '</span>';
echo '</div>';
}
?>
</div>
</div>
<div class="text-center">
<a class="btn btn-info" role="button" href=""><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> <?= __('Check', 'Check again') ?></a>
<?php
if (!is_file($conf_filename)) {
if ($errors === 0) {
?>
<a class="btn btn-primary" role="button" href="<?= Utils::get_server_name() . 'admin/install.php' ?>"><span class=" glyphicon glyphicon-arrow-right" aria-hidden="true"></span> <?= __('Check', 'Continue the installation') ?></a>
<?php
}
} else {
?>
<a class="btn btn-primary" role="button" href="<?= Utils::get_server_name() . 'admin/'?>"><span class=" glyphicon glyphicon-arrow-left" aria-hidden="true"></span> <?= __('Admin', 'Back to administration') ?></a>
<?php
}
?>
</div>
</div>